Jump to content

PHP error code during e-mail varifacation script


pnkgirl25

Recommended Posts

Hey guys. I keep getting the following error(s) when I run the script:

 

 

Warning: mysql_query(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/f/o/c/focusevents/html/signup_ac.php on line 20

 

Warning: mysql_query(): A link to the server could not be established in /home/content/f/o/c/focusevents/html/signup_ac.php on line 20

Not found your email in our databaseCannot send Confirmation link to your e-mail address

 

can someone tell me what might be the problem. My code is as follow:

 

<?
include('config.php');

// table name 
$tbl_name=temp_members_db;

// Random confirmation code 
$confirm_code=md5(uniqid(rand()));

// values sent from form 
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$email=$_POST['email'];
$weddingdate=$_POST['weddingdate'];
$username=$_POST['username'];
$password=$_POST['password'];

// Insert data into database 
$sql="INSERT INTO $tbl_name(confirm_code, firstname, lastname, email, weddingdate, username, password)VALUES('$confirm_code', '$firstname', '$lastname', '$email', '$weddingdate', '$username', '$password')";
$result=mysql_query($sql);

// if suceesfully inserted data into database, send confirmation link to email 
if($result){

// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to=$email;

// Your subject
$subject="Your One Spot confirmation link";

// From
$header="from: One Spot <your email>";

// Your message
$message="Thank you for joining One Stop\r\n";
$message="To activate your account please click on the link bellow\r\n";
$message.="Click on this link to activate your account \r\n";
$message.="http://www.yourweb.com/confirm.php?passkey=$confirm_code";

// send email
$sentmail = mail($to,$subject,$message,$header);

}

// if not found 
else {
echo "Not found your email in our database";
}

// if your email succesfully sent
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send Confirmation link to your e-mail address";
}

?>

 

 

 

 

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.