I am working with the following PHP script:
?
$to = "myemail9@anywhere.com";
$msg = "$name\n\n";
$msg .="$email\n\n";
$msg .="$message\n\n";
mail($to, "info email", $msg, "From: My web site\nReply-To: $email\n");
?>
and the following html:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="form.php">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
this works so far but:
When submitted the form navigates to a page that is the php form, which is blank and useless.
I want to:
1. When submitted clear the form
2. Pop up a new window with a seperate html page in it.
3. Keep the original window open and on the current page.
I basically want to add my form on my hompage and I don't want to make a whole new page for the form. I just want to put it at the bottom of my homepage and people can submit their emails and then keep viewing that page.
I could really use some help on this I have gotten the form to go to a new page with "header (location:..)
navigates away from the original page.
thanks for any help,
form.php**************
<?
$to = "pmjohnson99@yahoo.com";
$msg = "$_GET[name]\n\n";
$msg .="$_GET[email]\n\n";
$msg .="$_GET[msg]\n\n";
mail($to, "info email", $msg, "From: My web site\nReply-To: $GET[email]\n");
//here you can specify the page or url to open, you can create a separate thank you page, and put the path below
//and you can include the close window button in that thank you page
header ("Location: thankyou.php");
exit;
?>