Hello,
Sometimes I just don't get it. When I run it through a PHP debugerNo syntax Errors found. No General Errors
But it doesn't work. Here is the script:
Can someone show me what is wrong with this script?PHP Code:<?php
//PHP Form Mail - By fileserverdirect
$message="Hello, Your Website just Had another submisson at (".time()."), Here are the details:<br>\n";
foreach($_POST as $var -> $val)
{
if($var!="emailowner")
{
$var = ucfirst($var);
$message.="-----<br>\n".$var." : ".$val."<br>\n";
}
if($var=="emailowner")
{
$email = $val;
}
else if($var=="name")
{
$subj = "Message from " . $name;
}
}
/*$message = $_POST['mess'];
$email = $_POST['email'];
$name = $_POST['name'];*/
$sent="false";
if($_POST['submit'])
{
if(mail($email, $subj, $message, "From: \"Your Website\""))
{
echo "Message sent!";
$sent = "true";
}
else
{
echo "Error sending message.";
}
}
else
{
echo"Please fill out the form on this page.";
}
echo '<form action="mailit.php" method="post">
<input type="hidden" name="emailowner" value="me@myemail.com">
<input type="hidden" name="submit" value="true">
<textarea name="mess" rows=10 cols=30>
</textarea><br>
Email:<input type="text" name="email">
Name:<input type="text" name="name">
<input type="submit" value="Submit">
</form><br>';
?>
<!-- some other website stuff here-->
<?
if($sent=="true")
{
echo " The Message \"" . $message . "\" was sent to \"" . $email . "\"";
}
?>



Reply With Quote

Bookmarks