This is a discussion on "PHP Forgot password script error" within the PHP Forum section. This forum, and the thread "PHP Forgot password script error are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP Forgot password script error
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
PHP Forgot password script error
I'm having a problem getting my forgot password retrieval script to work. Won't send an email. the MySql database is ok & contains the username that is required and the member's password & email address.
All other files work with the required script pages (conn, includes, etc) so I think the problem must be with the script below. Would appreciate it if someone could look this over & see if there is an obvious error. Thanks!!! <? require_once("conn.php"); require_once("includes.php"); require_once("templates/HeaderTemplate.php"); if(isset($_POST[u2])) { $q1 = "select * from yellow_agents where username = '$_POST[u2]' "; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) == '1') { //ok $a1 = mysql_fetch_array($r1); $to = $a1[email]; $subject = "Your password"; $message = "Hello $a1[FirstName] $a1[LastName],\nYour login details are:\n\nUsername: $a1[username]\nPassword: $a1[password]\n\nhttp://$_SERVER[HTTP_HOST]"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "X-Mailer: PHP/" . phpversion()."\n"; ////donotmail($to, $subject, $message, $headers); require_once("templates/ForgotYes.php"); require_once("templates/FooterTemplate.php"); exit(); } else { $error2 = "<center><font face=verdana size=2 color=red>There is no username <b>$_POST[u2]</b> at our database!</font></center>"; } } require_once("templates/ForgotTemplate.php"); require_once("templates/FooterTemplate.php"); ?> |
|
|
|
||||
|
Re: PHP Forgot password script error
Do you get a message saying the email has been sent?
|
|
|||
|
Re: PHP Forgot password script error
Yes, I do get a message saying the email has been sent. But no email arrives. The email address is ok in MySql. That makes me wonder as well, because now when I try to send an email through another script on the site, it doesn't work either. So perhaps the fault is with an email script? The registration script we use posts email addresses ok in the database.
Here is the email script we are using: <? require_once("conn.php"); require_once("includes.php"); //get the agent info $q1 = "select * from yellow_agents where AgentID = '$_GET[AgentID]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); if(isset($_POST[s1])) { $to = $a1[email]; $subject = $_POST[subject]; $message = $_POST[message]; $message .= "\n\nOffer:\nhttp://$_SERVER[HTTP_HOST]/info.php?id=$_GET[AgentID]\n\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "From: $_POST[u_name] <$aset[ContactEmail]>\n"; $headers .= "Reply-To: $_POST[u_name] <$_POST[u_email]>\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: PHP/" . phpversion(); //donotmail($to, $subject, $message, $headers); $thankyou = "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"info.php?id=$_GET[AgentID]\">back to the offer details</a></center>"; //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailThankyouTemplate.php"); require_once("templates/FooterTemplate.php"); } $AgentName = "$a1[FirstName] $a1[LastName]"; //get the templates require_once("templates/HeaderTemplate.php"); require_once("templates/EmailTemplate.php"); require_once("templates/FooterTemplate.php"); ?> |
|
|||
|
Re: PHP Forgot password script error
May be helpful to you.
Here is a function of sending the mails.It needs your own email account to open the smtp port. Good luck!
|
|
||||
|
Re: PHP Forgot password script error
This is the least I'd want to do.
|
![]() |
| Tags |
| error, forgot, php |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Forgot password and Change password PHP script | Chono | PHP Forum | 4 | May 16th, 2008 09:13 |
| Password script needs refining. | liwolfbyte | JavaScript Forum | 4 | Sep 3rd, 2007 20:05 |
| md5 password error | csun | PHP Forum | 2 | May 9th, 2007 02:29 |
| PHP Forgot Password script | chrizlord | PHP Forum | 11 | May 1st, 2007 00:19 |