hey guys.. trying to send a mail but its throwing an error as such:[B] Warning: Failed to Receive in c:phpdevwwwmobile_test.php on line 92
im posting in values from a previous page but, they are posting in correctly and inserting into the database but hits the error above at:
[code=php]$mail_result = mail(“[email protected]”, $subject, $message);
i cannot see whats wrong with it please advise.
the entire code is …
[code=php]<?php
session_start();//Starts the session for session variables
header(“Cache-control: private”); //Fix for IE6 Step Back
?>
<html>
<head>
<title>Register Success</title>
<style fprolloverstyle>A:hover {color: #0000ff; font-weight: bold}
</style>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″></head>
<?php
$Student_Username = $_POST[‘username’];
$Student_Password = $_POST[‘password’];
$Student_FirstName = $_POST[‘first_name’];
$Student_number = $_POST[‘number’];
session_register(‘$Student_Username’);
session_register(‘$Student_Password’);
session_register(‘$Student_FirstName’);
session_register(‘$Student_number’);
$_SESSION[‘Student_Username’] = $Student_Username;
$_SESSION[‘Student_Password’] = $Student_Password;
$_SESSION[‘Student_FirstName’] = $Student_FirstName;
$_SESSION[‘Student_number’] = $Student_number;
?>
<?php
if((!$Student_Username) || (!$Student_Password) ||
(!$Student_FirstName) || (!$Student_number)){
include ‘mobile_test_a.php’; // Show the form again!
echo ‘<div align=”center”><font color=”#3c8aff”><b>You did not submit
the following required information!</b></div><br />’;
if(!$Student_Username){
echo ‘<div align=”center”><b>Username</b></div><br>’;
}
if(!$Student_Password){
echo ‘<div align=”center”><b>Password</b></div><br>’;
}
if(!$Student_FirstName){
echo ‘<div align=”center”><b>First Name</b></div><br>’;
}
if(!$Student_number){
echo ‘<div align=”center”><b>number</b></div><br>’;
}
echo ‘<div align=”center”><b>Please enter all your details
and click to submit.</b></font></div><br>’;
exit(); // if the error checking has failed, we’ll exit the script!
}
$db = mysql_connect (‘localhost’, ”,”) or die (‘could not connect to MYSQL because: ‘ . mysql_error());
mysql_select_db (blueprintdb) or die (‘could not select the DB because: ‘ . mysql_error());
$sql = mysql_query(“INSERT INTO studentreg(Student_Username,Student_Password,Student_FirstName,Student_number)
VALUES
(‘$Student_Username’,’$Student_Password’,’$Student_FirstName’,’$Student_number’)”);
$subject = “hey”;
$message = “user:PhilFlynn
password:remember22
api_id:2404290
to:$Student_number
text:Congrats $Student_Username, your now a member!”;
// $mob_to is a variable with their mobile number in it.
$mail_result = mail(“[email protected]”, $subject, $message);
?>