heirani1 Posted June 17, 2008 Share Posted June 17, 2008 ive been trying to teach myself php by tutorials and stuff and i am trying to create a script where they register and then a conformation link is sent to their email, when they click the link they then become a member. i have a problem though ... heres the code for the page .. <? include('config.php'); // table name $tbl_name=temp_members_db; // Random confirmation code $confirm_code=md5(uniqid(rand())); // values sent from form $name=$_POST['name']; $email=$_POST['email']; $country=$_POST['country']; // Insert data into database $sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')"; $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 confirmation link here"; // From $header="from: your name <your email>"; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on this link to activate your account \r\n"; $message.="http://localhost/Test/sign_up/confirmation.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"; } ?> when the form goes to this page it just prints some of the code to the screen, which is ... "; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on this link to activate your account \r\n"; $message.="http://localhost/Test/sign_up/confirmation.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"; } ?> Any help in resolving this would be much appreciated, Chris Link to comment https://forums.phpfreaks.com/topic/110566-sign-up-php-script-help/ Share on other sites More sharing options...
conker87 Posted June 17, 2008 Share Posted June 17, 2008 Rule #1: Use FULL tags: <?php Never use short tags, they're not supported on all servers and I think they're deprecated in php5/6. Link to comment https://forums.phpfreaks.com/topic/110566-sign-up-php-script-help/#findComment-567236 Share on other sites More sharing options...
heirani1 Posted June 17, 2008 Author Share Posted June 17, 2008 thanks, i didnt realise that, thanks again for your help! Link to comment https://forums.phpfreaks.com/topic/110566-sign-up-php-script-help/#findComment-567271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.