| | |
Email Confirmation Prob
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
im a newbie php developer...
i've tried sending an email n receiving the confirmation back for activating the users...
here is the email sending code :
here is the Confirmation Page :
On clicking the link in my email, i get a BLANK confirmation page...
wat is the prob.. ?
need help
i've tried sending an email n receiving the confirmation back for activating the users...
here is the email sending code :
PHP Syntax (Toggle Plain Text)
if($res) { echo "record added"; $to = $mail; $sub = "Confirm Mail From LeLys"; $header = "from: admin<support@domain.org>"; $message = "confirm link \r\n"; $message.= "click to activete your account"; $message.= "http://www.domain.org/confirmation.php?key=$ccode"; $sending = mail($to,$sub,$message,$header); if($sending) echo ("email comfirm"); else echo("email not sent"); }
here is the Confirmation Page :
PHP Syntax (Toggle Plain Text)
$passkey = $_GET['key']; $sql1 = "SELECT * FROM temp_db WHERE code='$passkey'"; $result1 = mysql_query($sql1); if($result1) { // Count how many row has this passkey $count = mysql_num_rows($result1); // if found this passkey in our database, retrieve data from table "temp_members_db" if($count == 1) { $rows = mysql_fetch_array($result1); $a = $rows['fname']; $b = $rows['mname']; $c = $rows['lname']; $d = $rows['dob']; $e = $rows['gender']; $f = $rows['email']; $g = $rows['country']; $h = $rows['phno']; $i = $rows['mobile']; $j = $rows['userid']; $k = $rows['password']; $l = $rows['mti']; $m = = $rows['rtime']; $sql2 = "INSERT INTO regd_db(fname,mname,lname,dob,gender,email,country,phno,mobile,userid,password,mti,rtime) VALUES('$a','$b','$c','$d','$e','$f','$g','$h','$i','$j','$k','$l','$m')"; $result2 = mysql_query($sql2); } // if not found passkey, display message "Wrong Confirmation code" else echo "Wrong confirmation code"; // if successfully moved data from table"temp" to table "registered" display"Your account has been activated" if($result2) { echo "You hav Been Activated.. please log in"; $sql3 = "DELETE FROM temp_db WHERE code='$passkey'"; $result3 = mysql_query($sql3) or die("Cud not delete temp files"); } }
On clicking the link in my email, i get a BLANK confirmation page...
wat is the prob.. ?
need help
•
•
Join Date: Jul 2007
Posts: 77
Reputation:
Solved Threads: 5
•
•
•
•
im a newbie php developer...
i've tried sending an email n receiving the confirmation back for activating the users...
here is the email sending code :
PHP Syntax (Toggle Plain Text)
if($res) { echo "record added"; $to = $mail; $sub = "Confirm Mail From LeLys"; $header = "from: admin<support@domain.org>"; $message = "confirm link \r\n"; $message.= "click to activete your account"; $message.= "http://www.domain.org/confirmation.php?key=$ccode"; $sending = mail($to,$sub,$message,$header); if($sending) echo ("email comfirm"); else echo("email not sent"); }
here is the Confirmation Page :
PHP Syntax (Toggle Plain Text)
$passkey = $_GET['key']; $sql1 = "SELECT * FROM temp_db WHERE code='$passkey'"; $result1 = mysql_query($sql1); if($result1) { // Count how many row has this passkey $count = mysql_num_rows($result1); // if found this passkey in our database, retrieve data from table "temp_members_db" if($count == 1) { $rows = mysql_fetch_array($result1); $a = $rows['fname']; $b = $rows['mname']; $c = $rows['lname']; $d = $rows['dob']; $e = $rows['gender']; $f = $rows['email']; $g = $rows['country']; $h = $rows['phno']; $i = $rows['mobile']; $j = $rows['userid']; $k = $rows['password']; $l = $rows['mti']; $m = = $rows['rtime']; $sql2 = "INSERT INTO regd_db(fname,mname,lname,dob,gender,email,country,phno,mobile,userid,password,mti,rtime) VALUES('$a','$b','$c','$d','$e','$f','$g','$h','$i','$j','$k','$l','$m')"; $result2 = mysql_query($sql2); } // if not found passkey, display message "Wrong Confirmation code" else echo "Wrong confirmation code"; // if successfully moved data from table"temp" to table "registered" display"Your account has been activated" if($result2) { echo "You hav Been Activated.. please log in"; $sql3 = "DELETE FROM temp_db WHERE code='$passkey'"; $result3 = mysql_query($sql3) or die("Cud not delete temp files"); } }
On clicking the link in my email, i get a BLANK confirmation page...
wat is the prob.. ?
need help
PHP Syntax (Toggle Plain Text)
if($result2) { echo "You hav Been Activated.. please log in"; $sql3 = "DELETE FROM temp_db WHERE code='$passkey'"; $result3 = mysql_query($sql3) or die("Cud not delete temp files"); }else { echo 'problems found'; }
let see if which will it print.
•
•
Join Date: Aug 2007
Posts: 55
Reputation:
Solved Threads: 9
Usually all output disappears from your browser if you have an error in your code, and error_reporting is set to E_ALL & E_NOTICE in your php.ini file.
In this case, i think your error, is that you are using trying to access array items using associative indices, when your array only has number indices because you used mysql_fetch_array.
Therefore if you use mysql_fetch_array($result1), then access your array items as $rows[0], $rows[1], ...
If you use mysql_fetch_assoc($result1), then access your array items as $rows['country'], $rows['mobile'], ...
Try that !
In this case, i think your error, is that you are using trying to access array items using associative indices, when your array only has number indices because you used mysql_fetch_array.
Therefore if you use mysql_fetch_array($result1), then access your array items as $rows[0], $rows[1], ...
If you use mysql_fetch_assoc($result1), then access your array items as $rows['country'], $rows['mobile'], ...
Try that !
hey wilch..
i've tried that assoc fetch, but still get the same blank page..
i saw my php.ini file..
error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
this is wat i found in it...
does this mean anything related to my prob.. ? coz i dont know..
i've tried that assoc fetch, but still get the same blank page..
i saw my php.ini file..
error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
this is wat i found in it...
does this mean anything related to my prob.. ? coz i dont know..
![]() |
Similar Threads
- How to set up a multi step registration? (ASP.NET)
- email confirmation (PHP)
- how to make an account activation by email (PHP)
- Email Application (ASP.NET)
- JSP shopping cart (JSP)
- Email activation (Social Media and Online Communities)
- Automatic email reply to Form (Site Layout and Usability)
- Email verification? (Social Media and Online Communities)
- Guest Registration (DaniWeb Community Feedback)
Other Threads in the PHP Forum
- Previous Thread: New great php templete engine (RainTPL)
- Next Thread: advice from thesis
| Thread Tools | Search this Thread |
.htaccess ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl customizableitems database date delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube





