Here is the error that I'm getting in my error.log
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: poster in
>c:\program files\apache group\apache\htdocs\contact.php on line 29
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: name in
>c:\program files\apache group\apache\htdocs\contact.php on line 63
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: company
>in c:\program files\apache group\apache\htdocs\contact.php on line 64
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: street in
>c:\program files\apache group\apache\htdocs\contact.php on line 65
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: city in
>c:\program files\apache group\apache\htdocs\contact.php on line 66
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: state in
>c:\program files\apache group\apache\htdocs\contact.php on line 67
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: zip in c:
>\program files\apache group\apache\htdocs\contact.php on line 68
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: email in
>c:\program files\apache group\apache\htdocs\contact.php on line 69
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: comments
>in c:\program files\apache group\apache\htdocs\contact.php on line 70
This script works fine locally, but when I upload it to the server, I get theses error. All I can think of is that the php.ini file is incorrectly configured, but I'm very new to php and it might be something in my code.
I have a form that submits to this code...
<?
$mailSent = "false";
///////////////////////////////
//POSTER is one of the errors//
///////////////////////////////
if($HTTP_POST_VARS["poster"] != "" && $HTTP_POST_VARS["name"] != ""{
$ToEmail = "MyName@aol.com";
$ToSubject = "Contact Form";
$eName=$HTTP_POST_VARS["name"];
$eCompany=$HTTP_POST_VARS["company"];
$eStreet=$HTTP_POST_VARS["street"];
$eCity=$HTTP_POST_VARS["city"];
$eState=$HTTP_POST_VARS["state"];
$eZip=$HTTP_POST_VARS["zip"];
$eEmail=$HTTP_POST_VARS["email"];
$eComments=$HTTP_POST_VARS["comments"];
$EmailBody = "Name: $eName\nCompany: $eCompany\nStreet: $eStreet\nCity: $eCity\nState: $eState\nZip: $eZip\nEmail: $eEmail\nComments: $eComments";
$Message = $EmailBody;
if(mail("Tech <".$ToEmail.">",$ToSubject, $Message, "From: ".$eName." <".$eEmail.">"){
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>Thank You!</font><br>";
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>Your message has been sent...</font>";
$eName="";
$eCompany="";
$eStreet="";
$eCity="";
$eState="";
$eZip="";
$eEmail="";
$eComments="";
$mailSent="true";
$HTTP_POST_VARS["poster"]="";
$HTTP_POST_VARS["name"]="";
} else {
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>An error has occured, please reload page and try again.</font><br><br>";
}
} else {
///////////////////////////////////////////
//Section below produces the other errors//
///////////////////////////////////////////
$eName=$HTTP_POST_VARS["name"];
$eCompany=$HTTP_POST_VARS["company"];
$eStreet=$HTTP_POST_VARS["street"];
$eCity=$HTTP_POST_VARS["city"];
$eState=$HTTP_POST_VARS["state"];
$eZip=$HTTP_POST_VARS["zip"];
$eEmail=$HTTP_POST_VARS["email"];
$eComments=$HTTP_POST_VARS["comments"];
}
Thanks,
Greg
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: poster in
>c:\program files\apache group\apache\htdocs\contact.php on line 29
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: name in
>c:\program files\apache group\apache\htdocs\contact.php on line 63
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: company
>in c:\program files\apache group\apache\htdocs\contact.php on line 64
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: street in
>c:\program files\apache group\apache\htdocs\contact.php on line 65
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: city in
>c:\program files\apache group\apache\htdocs\contact.php on line 66
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: state in
>c:\program files\apache group\apache\htdocs\contact.php on line 67
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: zip in c:
>\program files\apache group\apache\htdocs\contact.php on line 68
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: email in
>c:\program files\apache group\apache\htdocs\contact.php on line 69
>[Mon Oct 28 08:59:29 2002] [error] PHP Notice: Undefined index: comments
>in c:\program files\apache group\apache\htdocs\contact.php on line 70
This script works fine locally, but when I upload it to the server, I get theses error. All I can think of is that the php.ini file is incorrectly configured, but I'm very new to php and it might be something in my code.
I have a form that submits to this code...
<?
$mailSent = "false";
///////////////////////////////
//POSTER is one of the errors//
///////////////////////////////
if($HTTP_POST_VARS["poster"] != "" && $HTTP_POST_VARS["name"] != ""{
$ToEmail = "MyName@aol.com";
$ToSubject = "Contact Form";
$eName=$HTTP_POST_VARS["name"];
$eCompany=$HTTP_POST_VARS["company"];
$eStreet=$HTTP_POST_VARS["street"];
$eCity=$HTTP_POST_VARS["city"];
$eState=$HTTP_POST_VARS["state"];
$eZip=$HTTP_POST_VARS["zip"];
$eEmail=$HTTP_POST_VARS["email"];
$eComments=$HTTP_POST_VARS["comments"];
$EmailBody = "Name: $eName\nCompany: $eCompany\nStreet: $eStreet\nCity: $eCity\nState: $eState\nZip: $eZip\nEmail: $eEmail\nComments: $eComments";
$Message = $EmailBody;
if(mail("Tech <".$ToEmail.">",$ToSubject, $Message, "From: ".$eName." <".$eEmail.">"){
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>Thank You!</font><br>";
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>Your message has been sent...</font>";
$eName="";
$eCompany="";
$eStreet="";
$eCity="";
$eState="";
$eZip="";
$eEmail="";
$eComments="";
$mailSent="true";
$HTTP_POST_VARS["poster"]="";
$HTTP_POST_VARS["name"]="";
} else {
echo "<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color=#003399>An error has occured, please reload page and try again.</font><br><br>";
}
} else {
///////////////////////////////////////////
//Section below produces the other errors//
///////////////////////////////////////////
$eName=$HTTP_POST_VARS["name"];
$eCompany=$HTTP_POST_VARS["company"];
$eStreet=$HTTP_POST_VARS["street"];
$eCity=$HTTP_POST_VARS["city"];
$eState=$HTTP_POST_VARS["state"];
$eZip=$HTTP_POST_VARS["zip"];
$eEmail=$HTTP_POST_VARS["email"];
$eComments=$HTTP_POST_VARS["comments"];
}
Thanks,
Greg