Jump to content

interting email address into mysql table


kev wood

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.