kev wood Posted July 24, 2008 Share Posted July 24, 2008 i am trying to store an email address inside a mysql table and when i try to import the address i am getting this error Parse error: parse error, unexpected '@' in /home/kchamber/public_html/mercury/add_user.php on line 5 how can i get round this problem. the address is being stored in a variable and then inserted into the the table. well at least it is meant to be Link to comment https://forums.phpfreaks.com/topic/116408-interting-email-address-into-mysql-table/ Share on other sites More sharing options...
DarkWater Posted July 24, 2008 Share Posted July 24, 2008 Show us the code please. Link to comment https://forums.phpfreaks.com/topic/116408-interting-email-address-into-mysql-table/#findComment-598603 Share on other sites More sharing options...
kev wood Posted July 24, 2008 Author Share Posted July 24, 2008 here you go include'db.php'; $first_name = stripslashes(keith); $last_name = stripslashes(lynch); $email_address = ([email protected]); <-- this is tyhe line it dont like $username = stripslashes(keith); $info = stripslashes(); $activated = stripslashes(1) function makeRandomPassword() { $salt = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789!£$%^&*()_+-=`¬{}[];:'#@~<>,/.\|"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $random_password = makeRandomPassword(); $db_password = md5($random_password); // Enter info into the Database. $info2 = htmlspecialchars($info); $sql = mysql_query("INSERT INTO merc_users (first_name, last_name, email_address, username, password, info, signup_date, decrypted_password, activated) VALUES('$first_name', '$last_name', '$email_address', '$username', '$db_password', '$info2', now(), '$random_password', $activated)") or die (mysql_error() . mysql_errno()); ?> instead of using the @ symbol could use the the coded equivalent by this i meant %5C is a \ but i dont know what the proper description of this is called so i cannot search for the @ symbols equivalent to this. Link to comment https://forums.phpfreaks.com/topic/116408-interting-email-address-into-mysql-table/#findComment-598613 Share on other sites More sharing options...
DarkWater Posted July 24, 2008 Share Posted July 24, 2008 Well, you don't have quotation marks around it, or the parameters for stripslashes either. Link to comment https://forums.phpfreaks.com/topic/116408-interting-email-address-into-mysql-table/#findComment-598614 Share on other sites More sharing options...
kev wood Posted July 24, 2008 Author Share Posted July 24, 2008 i took the stripslashes out to see if made any different. why is always a semi colon or something stupid like that. i wil learn. (in bout 10 years time ha ha) Link to comment https://forums.phpfreaks.com/topic/116408-interting-email-address-into-mysql-table/#findComment-598660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.