View Single Post
Old July 1st, 2008, 6:11 PM   #6 (permalink)
Mark
Surpass Developer
Excelling Contributor
 
Mark's Avatar
 
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
509 posts
Gave thanks: 20
Thanked 78 times
Your problem is the code below. First you are escaping the data using mysql_real_escape_string() and then you are un-escaping the escaped data using stripslashes().

PHP Code:
$first mysql_real_escape_string($_POST['first']);
$middle mysql_real_escape_string($_POST['middle']);
$last mysql_real_escape_string($_POST['last']);
$email mysql_real_escape_string($_POST['email']);
$wphone mysql_real_escape_string($_POST['wphone']);
$cphone mysql_real_escape_string($_POST['cphone']);
$username mysql_real_escape_string($_POST['username']);
$location mysql_real_escape_string($_POST['location']);
 
/* Let's strip some slashes in case the user entered 
any escaped characters. */ 
$first stripslashes($first); 
$middle stripslashes($middle); 
$last stripslashes($last); 
$email stripslashes($email); 
$wphone stripslashes($wphone); 
$cphone stripslashes($cphone); 
$username stripslashes($username); 
$location stripslashes($location); 
Basically you are doing the following:

PHP Code:
$first stripslashes(mysql_real_escape_string($_POST['first'])) 
Which is the same thing as:

PHP Code:
$first $_POST['first'
stripslashes() needs to be executed before mysql_real_escape_string() or removed entirely
__________________
Mark
Surpass Hosting Developer
sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ
Mark is offline   Reply With Quote
This user thanks Mark for this great post!
hunna03 (July 1st, 2008)