Any suggestions as to why I'm getting these errors, and how I can correct them?
I've tried removing the line: $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
...that did not help.
TIA for any help you can provide.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All 3 errors come from the same line in your process.php file:
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
Note the occurrances of the following:
HTTPS
SERVER_NAME
PHP_SELF
Since this variable "$where_form_is" does not appear anywhere in the process.php, remove the line. If the error still occurrs, then you haven't removed the line.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not receiving an email is different from the other errors. Was the email sent before?
Beyond that I know web hosts are being forced to define tougher spam filters. The "From:" field in your mail() function is not a valid email address. Try chaning it from this:
mail("webmaster@prestonmeadowhoa.org","Survey Form Submitted at website",$message,"From: phpFormGenerator");
to this:
mail("webmaster@prestonmeadowhoa.org","Survey Form Submitted at website",$message,"webmaster@prestonmeadowhoa.org");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Check boxes come in many forms and with many conditions. Essentially each check box has one of two values (checked, or not checked). The limits on how many boxes are allowed to be checked are defined by the form developer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I continue to get the following errors when I submit (test) my form:
PHP Notice: Undefined index: HTTPS
PHP Notice: Undefined variable: SERVER_NAME
PHP Notice: Undefined variable: PHP_SELF
Here is the code for my process.php file:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','medium');
pt_register('POST','meetings');
pt_register('POST','pedsign');
pt_register('POST','lease');
pt_register('POST','leased');
pt_register('POST','topic');
pt_register('POST','speaker');
pt_register('POST','committee');
pt_register('POST','program');
pt_register('POST','interactions');
pt_register('POST','improvements');
$improvements=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $improvements);
pt_register('POST','opinion');
$opinion=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $opinion);
pt_register('POST','street');
pt_register('POST','email');
pt_register('POST','phone');
if($email=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="medium: ".$medium."
meetings: ".$meetings."
pedsign: ".$pedsign."
lease: ".$lease."
leased: ".$leased."
topic: ".$topic."
speaker: ".$speaker."
committee: ".$committee."
program: ".$program."
interactions: ".$interactions."
improvements: ".$improvements."
opinion: ".$opinion."
street: ".$street."
email: ".$email."
phone: ".$phone."
";
$message = stripslashes($message);
mail("webmaster@prestonmeadowhoa.org","Survey Form Submitted at website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.prestonmeadowhoa.org/thanks.html");
?><?php
}
?>
Any suggestions as to why I'm getting these errors, and how I can correct them?
I've tried removing the line: $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
...that did not help.
TIA for any help you can provide.
All 3 errors come from the same line in your process.php file:
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
Note the occurrances of the following:
HTTPS
SERVER_NAME
PHP_SELF
Since this variable "$where_form_is" does not appear anywhere in the process.php, remove the line. If the error still occurrs, then you haven't removed the line.
I removed the line, and got no errors this time, however the email was not delivered.
Not receiving an email is different from the other errors. Was the email sent before?
Beyond that I know web hosts are being forced to define tougher spam filters. The "From:" field in your mail() function is not a valid email address. Try chaning it from this:
mail("webmaster@prestonmeadowhoa.org","Survey Form Submitted at website",$message,"From: phpFormGenerator");
to this:
mail("webmaster@prestonmeadowhoa.org","Survey Form Submitted at website",$message,"webmaster@prestonmeadowhoa.org");
Thank you, it's working again...
To allow muliple checkboxes I must create a separate field for each box, correct?
Check boxes come in many forms and with many conditions. Essentially each check box has one of two values (checked, or not checked). The limits on how many boxes are allowed to be checked are defined by the form developer.
"Notices" are not "Errors". You should not have notices turned in your PHP settings in the first place, they are only for debugging purposes.