pnkgirl25 Posted August 24, 2007 Share Posted August 24, 2007 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"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/66486-php-error-code-during-e-mail-varifacation-script/ Share on other sites More sharing options...
AndyB Posted August 24, 2007 Share Posted August 24, 2007 $tbl_name=temp_members_db; should be $tbl_name="temp_members_db"; Quote Link to comment https://forums.phpfreaks.com/topic/66486-php-error-code-during-e-mail-varifacation-script/#findComment-332900 Share on other sites More sharing options...
pnkgirl25 Posted August 24, 2007 Author Share Posted August 24, 2007 I changed that however Im still getting the same error message Quote Link to comment https://forums.phpfreaks.com/topic/66486-php-error-code-during-e-mail-varifacation-script/#findComment-332901 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.