Firstly Hello to everyone on the forum. Im a neewbie here but have been using Kirupa to help me with a of odd stuff.
I am new to php scripting but thanks to this site I have found some code that shows me the basics of doing this. I have slightly amended the code and uploaded the two files .php and .htm to my server which is run by streaming.net.
The problem im having is that nothing gets emailed to me when the input boxes are filled in? can anyone help?
my .php code is:
<?PHP
$to = “ata.shahbazi@pervasic.com”;
$subject = “Results from your Request Info form”;
$headers = “From: Form Mailer”;
$forward = 0;
$location = “”;
$date = date (“l, F jS, Y”);
$time = date (“h:i A”);
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.
“;
if ($_SERVER[‘REQUEST_METHOD’] == “POST”) {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) .” : ". $value . "
“;
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) .” : ". $value . "
";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header (“Location:$location”);
}
else {
echo “Thank you for submitting our form. We will get back to you as soon as possible.”;
}
?>
and my .htm code is:
<html>
<body>
<title> Test Form page </title>
<form action=“mailer.php” method=“post”>
Type your first name:
<input type=“text” name=“FirstName” value=“” size=“30”>
<br>Type your last name:
<input type=“text” name=“LastName” value=“” size=“30”>
<br>
<input type=“submit” value=“Submit”>
</form>
</body>
</html>
I would appreciate any help I can get.
thanks