PHP Script - Help

Anything non-wireless related

PHP Script - Help

Postby shamrock365 » Sat Nov 24, 2007 1:39 pm

Hi,

I've attached a sample PHP script however I'm try to make changes to no avail.

1) I'd like to make the image verification to appear as the last item before the Submit Button. Currently it won't do so.

2) I'd like to attach the IP Address into the SQL data to be entered to the database (Or a seperate Database)


3) I'd like the URL box to have http:// already in the field. And if possible, it would be placed into the data to be submitted into the SQL Database if the user deletes it out of the field.

Idea's?

Shamrock365



<?php
session_start();
if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
////clean link
$keyword_list = explode(' ',mysql_escape_string($_POST['keyword']));
$link = mysql_escape_string($_POST['link']);
$title = mysql_escape_string($_POST['title']);
$desc = mysql_escape_string($_POST['description']);
include('dbcreds.php');
foreach ( $keyword_list as $k => $v ){
$sql = 'INSERT INTO `search_data` VALUES (NULL,"'.$v.'","'.$title.'","'.$link.'","'.$desc.'",0,CURRENT_TIMESTAMP(),0,0)';
mysql_query($sql);
}


unset($_SESSION['security_code']);
echo '<b>Profile successfully Stored!</b>';

} else {
// echo '<b>Image Verification Incorrect.Please Try Again</b>';


}






?>




<form action="" method="POST">

<table>
<tr>
<td>Your Name: </td>
<td><input type="text" name="keyword"></td>
<td><span style="font-size:10pt">(These Are The Words People Will Search For e.g. Tom Smith)</span></td>
</tr>
<p></p>
<tr>
<td>Your Blog Name: </td>
<td><input type="text" name="title"></td>
<td><span style="font-size:10pt">(The Title Of Your Blog)</span></td>
<tr>
<td>Link to Your URL: e.g. XYZ Consulting </td>
<td><input type="text" name="link"></td>
<td></td>
</tr>
<p></p>
<tr>
<td>A Short Description Of Your URL (Max 50 Words): </td>
<td><textarea name="description"></textarea></td>
<td></td>
</tr>
<p></p>
<tr>
<p><img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" alt="captcha" />
<input id="security_code" name="security_code" type="text" /></p>
</tr>
<p></p>


<tr>
<td colspan=2 align="center"><input type="submit" value="Submit!"></td>
<td></td>
</tr>
<p></p>
</table>

<p></p>


<p></p>
<a href="search.php">Return to Search</a>
</form>
Chuck Norris destroyed the Periodic Table, the only element he believes in is the element of surprise...
User avatar
shamrock365
Mini Stumbler
 
Posts: 148
Joined: Sun Dec 31, 2006 1:28 pm
Location: Ireland

Return to Off-Topic

Who is online

Users browsing this forum: No registered users and 3 guests

cron