mikebyrne Posted November 11, 2007 Share Posted November 11, 2007 I've setup as per the tutorial on (http://www.phpeasystep.com/phptu/24.html) but when my browser brings up the signup_ac.php file I get the following on screen "; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on this link to activate your account \r\n"; $message.="http://localhost/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"; } ?> My php code looks like this: <? 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: Mike Byrne <[email protected]>"; // Your message $message="Your Comfirmation link \r\n"; $message.="Click on this link to activate your account \r\n"; $message.="http://localhost/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"; } ?> I've WAMP5 running and I've a test.php page that displays fine so I'm presuming I've made a mistake in the code?? Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/ Share on other sites More sharing options...
Orio Posted November 11, 2007 Share Posted November 11, 2007 Check the source of the page. Does it display the full php code? If it does, first try switching your "<?" into "<?php". If that doesn't help, check if PHP is even installed on your server. Orio. Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389050 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 Changed it to >?php like suggested it seems to have worked but now getting an error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\signup_ac.php on line 17 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\signup_ac.php on line 17 Not found your email in our databaseCannot send Confirmation link to your e-mail address Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389068 Share on other sites More sharing options...
Orio Posted November 11, 2007 Share Posted November 11, 2007 You have wrong sql login details, or something is wrong with the sql server. Check your config.php to see if it has the correct login data for your mysql database and if it connects like it should. Orio. Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389074 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 Think i know whats up! Here's config.php <? $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name //Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); ?> Would I be right in asuming I've to fill out username, password,db_name?? Would you recommend I use <?php like before?? Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389075 Share on other sites More sharing options...
Orio Posted November 11, 2007 Share Posted November 11, 2007 Yes, you need to fill in the data in config.php. And yes, change "<?" to "<?php" since you don't have short-tags enabled on your server. Orio. Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389078 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 ok, i've changed everything and now i'n getting the error: cannot select DB The server is up and running and everything else seems to be working Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389079 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 Sorry config was pointing to table not Database. Fixed that error. Now getting: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\signup_ac.php on line 39 Cannot send Confirmation link to your e-mail address Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389082 Share on other sites More sharing options...
Orio Posted November 11, 2007 Share Posted November 11, 2007 Now you are having a real problem with the mail server... Either you don't have a mail-server installed, or you do but you haven't made the correct settings in your php.ini. If this is running on your local machine, install a mail server on your machine. If you are with some kind of host, contact your host and ask them what the problem is. Orio. Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389085 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 Ok I'll look into that now I'm using WAMP5 with VIsta, could you recommend one while I look? Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389087 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 I've setup a mailserver and now getting the error Warning: mail() [function.mail]: SMTP server response: 551 User not local. We don't relay in C:\wamp\www\signup_ac.php on line 39 Cannot send Confirmation link to your e-mail address Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389096 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 Downloaded Argosoft Mail Server. Is there is anyone who uses it that could help me config it to run on localhost?? I also need to config it for Outlook 2007 Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389120 Share on other sites More sharing options...
Orio Posted November 11, 2007 Share Posted November 11, 2007 Sorry I know nothing about installing mail servers and configuring them, try opening a new thread in the appropriate board (php installation I guess?) Orio. Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389133 Share on other sites More sharing options...
mikebyrne Posted November 11, 2007 Author Share Posted November 11, 2007 I've got it up and running but do I have to alter my php.ini file because im still getting the error Warning: mail() [function.mail]: SMTP server response: 551 User not local. We don't relay in C:\wamp\www\signup_ac.php on line 39 Cannot send Confirmation link to your e-mail address Link to comment https://forums.phpfreaks.com/topic/76843-verfying-email-address-problem/#findComment-389136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.