When I submit my form, It goes to the confirmation page, and all the fields are blank… then I receive an email with the fields blank.
Any suggestions? Here's the Form and Processor.php
<HTML><HEAD><TITLE>My Form - created with phpFormGenerator</TITLE></HEAD> <BODY> <font face='arial' size=2><b>All fields marked with a * are required:<br> <form enctype='multipart/form-data' action='process.php' method='post'> <table width='50%' border=0> <tr><td> Name</td> <td> <input type=text name='Name' size=30></td></tr> <tr><td> Attending</td> <td> <input type=radio name='Attending' value='Yes'>Yes<br><input type=radio name='Attending' value='No'>No<br></td></tr> <tr><td> Guests</td> <td> <input type=text name='Guests' size=2></td></tr> <tr><td> GuestNames</td> <td> <textarea name='GuestNames' rows=30 cols=30></textarea></td></tr> </table> <input type='submit' value='Submit Form'> <input type=reset value='Clear Form'></form> <br><br><br><a href='http://phpformgen.sourceforge.net'><img src='button.jpg' border=0></a> </BODY></HTML>
<?php include("global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','Name'); pt_register('POST','Attending'); pt_register('POST','Guests'); pt_register('POST','GuestNames'); $GuestNames=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $GuestNames);if($errors==1) echo $error; else{ $where_form_is="http".($HTTP_SERVER_VARS=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Name: ".$Name." Attending: ".$Attending." Guests: ".$Guests." GuestNames: ".$GuestNames." "; $message = stripslashes($message); mail("myemail@email.email","Form Submitted at your website",$message,"From: phpFormGenerator"); $make=fopen("admin/data.dat","a"); $to_put=""; $to_put .= $Name."|".$Attending."|".$Guests."|".$GuestNames." "; fwrite($make,$to_put); ?>
<!- This is the content of the Thank you page, be careful while changing it ->
<h2>Thank you!</h2>
<table width=50%> <tr><td>Name: </td><td> <?php echo $Name; ?> </td></tr> <tr><td>Attending: </td><td> <?php echo $Attending; ?> </td></tr> <tr><td>Guests: </td><td> <?php echo $Guests; ?> </td></tr> <tr><td>GuestNames: </td><td> <?php echo $GuestNames; ?> </td></tr> </table> <!- Do not change anything below this line ->
<?php } ?>
Hello,
action =process.php?
Is the above php filename a typo?
You implied you were using processor.php
Log in to post a comment.
When I submit my form, It goes to the confirmation page, and all the fields are blank… then I receive an email with the fields blank.
Any suggestions? Here's the Form and Processor.php
<HTML><HEAD><TITLE>My Form - created with phpFormGenerator</TITLE></HEAD>
<BODY>
<font face='arial' size=2><b>All fields marked with a * are required:<br>
<form enctype='multipart/form-data' action='process.php' method='post'>
<table width='50%' border=0>
<tr><td> Name</td>
<td>
<input type=text name='Name' size=30></td></tr>
<tr><td> Attending</td>
<td>
<input type=radio name='Attending' value='Yes'>Yes<br><input type=radio name='Attending' value='No'>No<br></td></tr>
<tr><td> Guests</td>
<td>
<input type=text name='Guests' size=2></td></tr>
<tr><td> GuestNames</td>
<td>
<textarea name='GuestNames' rows=30 cols=30></textarea></td></tr>
</table>
<input type='submit' value='Submit Form'> <input type=reset value='Clear Form'></form>
<br><br><br><a href='http://phpformgen.sourceforge.net'><img src='button.jpg' border=0></a>
</BODY></HTML>
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Attending');
pt_register('POST','Guests');
pt_register('POST','GuestNames');
$GuestNames=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $GuestNames);if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Attending: ".$Attending."
Guests: ".$Guests."
GuestNames: ".$GuestNames."
";
$message = stripslashes($message);
mail("myemail@email.email","Form Submitted at your website",$message,"From: phpFormGenerator");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Name."|".$Attending."|".$Guests."|".$GuestNames."
";
fwrite($make,$to_put);
?>
<!- This is the content of the Thank you page, be careful while changing it ->
<h2>Thank you!</h2>
<table width=50%>
<tr><td>Name: </td><td> <?php echo $Name; ?> </td></tr>
<tr><td>Attending: </td><td> <?php echo $Attending; ?> </td></tr>
<tr><td>Guests: </td><td> <?php echo $Guests; ?> </td></tr>
<tr><td>GuestNames: </td><td> <?php echo $GuestNames; ?> </td></tr>
</table>
<!- Do not change anything below this line ->
<?php
}
?>
Hello,
action =process.php?
Is the above php filename a typo?
You implied you were using processor.php