I am trying to add a time stamp to a simple three field form, one being hidden. Below is the html code. I stripped out all the table and fancy stuff to post the meat of the code.
What do I need to change or ad to get the time stamp to be included in the email and also show in the admin page besides the word timestamp.
I am also wondering when 3.0 is going to Fantastico for webhosts?
Any help would be greatly appreciated.
Thanks
toc.htm
--------------------------------------------------------------------------
<form enctype='multipart/form-data' action='process.php' method='post'>
Please fill in all fields marked with a *
<br />
Agree<input type=radio name='Agree' value='Yes'>Yes
<input type=radio name='Agree' value='No'>No *
<br />
Your name<input type=text name='Signature' size=40>*
<br />
<input type='hidden' name='Timestamp' value='Timestamp'>
<br />
<input type=submit value='Submit'>
<input type=reset value='Reset'>
</form>
---------------------------------------------------------------------------------
Process.php
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Agree');
pt_register('POST','Signature');
pt_register('POST','Timestamp');
if($Agree=="" || $Signature=="" || $Timestamp=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Agree: ".$Agree."
Signature: ".$Signature."
Timestamp: ".$Timestamp."
";
$message = stripslashes($message);
mail("tos@yadayadayada.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$link = mysql_connect("localhost","xxxxxx_xxxtos","xxxxxxxxx");
mysql_select_db("xxxxxx_tos",$link);
$query="insert into Agreement (Agree,Signature,Timestamp) values ('".$Agree."','".$Signature."','".$Timestamp."')";
mysql_query($query);
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Agree."|".$Signature."|".$Timestamp."
";
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>Agree: </td><td> <?php echo $Agree; ?> </td></tr>
<tr><td>Signature: </td><td> <?php echo $Signature; ?> </td></tr>
<tr><td>Timestamp: </td><td> <?php echo $Timestamp; ?> </td></tr>
</table>
<!-- Do not change anything below this line -->
<?php
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I am trying to add a time stamp to a simple three field form, one being hidden. Below is the html code. I stripped out all the table and fancy stuff to post the meat of the code.
What do I need to change or ad to get the time stamp to be included in the email and also show in the admin page besides the word timestamp.
I am also wondering when 3.0 is going to Fantastico for webhosts?
Any help would be greatly appreciated.
Thanks
toc.htm
--------------------------------------------------------------------------
<form enctype='multipart/form-data' action='process.php' method='post'>
Please fill in all fields marked with a *
<br />
Agree<input type=radio name='Agree' value='Yes'>Yes
<input type=radio name='Agree' value='No'>No *
<br />
Your name<input type=text name='Signature' size=40>*
<br />
<input type='hidden' name='Timestamp' value='Timestamp'>
<br />
<input type=submit value='Submit'>
<input type=reset value='Reset'>
</form>
---------------------------------------------------------------------------------
Process.php
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Agree');
pt_register('POST','Signature');
pt_register('POST','Timestamp');
if($Agree=="" || $Signature=="" || $Timestamp=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Agree: ".$Agree."
Signature: ".$Signature."
Timestamp: ".$Timestamp."
";
$message = stripslashes($message);
mail("tos@yadayadayada.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$link = mysql_connect("localhost","xxxxxx_xxxtos","xxxxxxxxx");
mysql_select_db("xxxxxx_tos",$link);
$query="insert into Agreement (Agree,Signature,Timestamp) values ('".$Agree."','".$Signature."','".$Timestamp."')";
mysql_query($query);
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Agree."|".$Signature."|".$Timestamp."
";
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>Agree: </td><td> <?php echo $Agree; ?> </td></tr>
<tr><td>Signature: </td><td> <?php echo $Signature; ?> </td></tr>
<tr><td>Timestamp: </td><td> <?php echo $Timestamp; ?> </td></tr>
</table>
<!-- Do not change anything below this line -->
<?php
}
?>
Anyone able to help with this? I would like to move on with my project.
Thanks.