pinch
05-19-2006, 04:19 PM
Hi all,
am trying to work with session variables to send confirmation mails. getting this PHP Notice:
PHP Notice: Undefined index: mail in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 32 PHP Notice: Undefined index: mail in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 176 PHP Notice: Undefined index: pass in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 177 PHP Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 187 PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 250
the code from the session setting page is as follows:
session_start();
if (isset($HTTP_POST_VARS['Contact_E-mail'])) {$mail = $HTTP_POST_VARS['Contact_E-mail'];
session_register("mail");
}
if (isset($HTTP_POST_VARS['New_Password'])) {$pass = $HTTP_POST_VARS['New_Password'];
session_register("pass");
}
once they click on submit it goes to the next page to update the record with a serial number and send a confirmation mail.
the code is as follows:
28 //session
29 session_start();
30
31 //This is the Serial Updating part
32 $user_id = mysql_query("SELECT id FROM username WHERE mail = ". $_SESSION['mail']);
33 $serial = mysql_query("SELECT valid_serials FROM serial WHERE id = " . $user_id);
34
35 $query_1 = "LOCK TABLES username WRITE, list_of_serials WRITE";
36 mysql_query($query_1);
37
38 $query_2 = "UPDATE username SET valid_serials = " . $serial;
39 mysql_query($query_2);
40
41 $query_3 = "UNLOCK TABLES";
42 mysql_query($query_3);
174 <?php
175
176 $mail_to=$_SESSION['mail'];
177 $pass=$_SESSION['pass'];
178 $mail_from="info@tourismbeecharter.org";
179 $mail_sub="Thank you for using the self assessment software";
180 $mail_mesg="<p>Dear Member </br>
181 Thank you for using the Tourism BEE Charter Self Assessor,</br>
182 Your Details are as follows:</p>
183 <p>Username : $mail_to</br>
184 Password : $pass</p>";
185
186 //Check for success/failure of delivery
187 if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from"))
188 echo "<span class='textred'><p align='justify' class='style10'> An e-mail has been sent to ". $mail_to ." with your username and password. Please login to the member's area to get your serial number and download the self assessment software.</p></span>";
189
190 else
191 echo "<span class='textred'>Failed to send the confirmation E-mail to $mail_to , please login to the member's area to get your details or request for the username and password to be resent to you</span>";
192
193 ?>
for some reason it is not picing up the session variable... please help.
am trying to work with session variables to send confirmation mails. getting this PHP Notice:
PHP Notice: Undefined index: mail in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 32 PHP Notice: Undefined index: mail in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 176 PHP Notice: Undefined index: pass in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 177 PHP Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 187 PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\Inetpub\wwwroot\tourism bee charter self assessor\thank.php on line 250
the code from the session setting page is as follows:
session_start();
if (isset($HTTP_POST_VARS['Contact_E-mail'])) {$mail = $HTTP_POST_VARS['Contact_E-mail'];
session_register("mail");
}
if (isset($HTTP_POST_VARS['New_Password'])) {$pass = $HTTP_POST_VARS['New_Password'];
session_register("pass");
}
once they click on submit it goes to the next page to update the record with a serial number and send a confirmation mail.
the code is as follows:
28 //session
29 session_start();
30
31 //This is the Serial Updating part
32 $user_id = mysql_query("SELECT id FROM username WHERE mail = ". $_SESSION['mail']);
33 $serial = mysql_query("SELECT valid_serials FROM serial WHERE id = " . $user_id);
34
35 $query_1 = "LOCK TABLES username WRITE, list_of_serials WRITE";
36 mysql_query($query_1);
37
38 $query_2 = "UPDATE username SET valid_serials = " . $serial;
39 mysql_query($query_2);
40
41 $query_3 = "UNLOCK TABLES";
42 mysql_query($query_3);
174 <?php
175
176 $mail_to=$_SESSION['mail'];
177 $pass=$_SESSION['pass'];
178 $mail_from="info@tourismbeecharter.org";
179 $mail_sub="Thank you for using the self assessment software";
180 $mail_mesg="<p>Dear Member </br>
181 Thank you for using the Tourism BEE Charter Self Assessor,</br>
182 Your Details are as follows:</p>
183 <p>Username : $mail_to</br>
184 Password : $pass</p>";
185
186 //Check for success/failure of delivery
187 if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from"))
188 echo "<span class='textred'><p align='justify' class='style10'> An e-mail has been sent to ". $mail_to ." with your username and password. Please login to the member's area to get your serial number and download the self assessment software.</p></span>";
189
190 else
191 echo "<span class='textred'>Failed to send the confirmation E-mail to $mail_to , please login to the member's area to get your details or request for the username and password to be resent to you</span>";
192
193 ?>
for some reason it is not picing up the session variable... please help.