0810
09-14-2002, 06:29 AM
Could you please help my script
Hi how are you doing? What I am trying to do is I would like to print name, E-mail , password in the next page. In other words, when a user clicks sends button, next page will print name, E-mail, password. I tried to do this one but I couldn't do it.
Also,if a user misses filling out E-mail, it warns like " Fill out the E-mail"
My php is 4.22
Could you help me my script
here is my script
<html>
<head>
</head>
<body>
<p>Enter whatever</p>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
Name<input type="text" size="80" name="msg"><br>
E-mail<input type="text" size="80" name="mail">
<br>
Password<input type="text" size="80" name="password"><br>
<input type="submit" name="submit" value="Send">
<input type="reset" name="reset" value="reset">
</form>
<?php
if(isset($_POST["submit"]))
{
$msg=$_POST["msg"];
$mail=$_POST["mail"];
$password=$_POST["password"];
$fp=fopen("log.txt","a");
if(!$fp)
{
print("Can't open your file'");
exit;
}
fwrite($fp,"*******************************************************\r\n\r\n");
fwrite($fp,"Name:\t\t\t$msg\r\n");
fwrite($fp,"E-mail:\t\t$mail\r\n\r\n");
fwrite($fp,"Password:\t\t$password\r\n\r\n");
fclose($fp);
print("Thank you for filling out my form<br>\n");
}
?>
</body>
</html>
Could you please help me
Thanks
Hi how are you doing? What I am trying to do is I would like to print name, E-mail , password in the next page. In other words, when a user clicks sends button, next page will print name, E-mail, password. I tried to do this one but I couldn't do it.
Also,if a user misses filling out E-mail, it warns like " Fill out the E-mail"
My php is 4.22
Could you help me my script
here is my script
<html>
<head>
</head>
<body>
<p>Enter whatever</p>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
Name<input type="text" size="80" name="msg"><br>
E-mail<input type="text" size="80" name="mail">
<br>
Password<input type="text" size="80" name="password"><br>
<input type="submit" name="submit" value="Send">
<input type="reset" name="reset" value="reset">
</form>
<?php
if(isset($_POST["submit"]))
{
$msg=$_POST["msg"];
$mail=$_POST["mail"];
$password=$_POST["password"];
$fp=fopen("log.txt","a");
if(!$fp)
{
print("Can't open your file'");
exit;
}
fwrite($fp,"*******************************************************\r\n\r\n");
fwrite($fp,"Name:\t\t\t$msg\r\n");
fwrite($fp,"E-mail:\t\t$mail\r\n\r\n");
fwrite($fp,"Password:\t\t$password\r\n\r\n");
fclose($fp);
print("Thank you for filling out my form<br>\n");
}
?>
</body>
</html>
Could you please help me
Thanks