Hi to the php expert's! Im always getting error message on my server with this email form. Hope some1 can fix this. Tnx...
The script is as follow:
feedback.php
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Mailer</title>
</head>
<body>
<h2>Feedback Form</h2>
<form method="post" action="sendemail.php">
PHP Code:
<?php
$ipi = getenv("REMOTE__ADDR");
$httpref = getenv("HTTP__REFERER");
$httpagenti = getenv("HTTP__USER__AGENT");
?>
HTML Code:
<input type="hidden" name="ip" value="
PHP Code:
<?php echo $ ipi ?>
HTML Code:
" />
<input type="hidden" name="httprefi" value="
PHP Code:
<?php echo $ httprefi ?>
HTML Code:
" />
<input type="hidden" name="httpagent" value="
PHP Code:
<?php echo $ httpagenti ?>
HTML Code:
" />
Name :<br />
<input type="text" name="visitor" size="23" /><br />
E-mail :<br />
<input type="text" name="visitormail" size="23 /><br />
<br /> <br />
Concern :<br />
<select name="attn" size="1">
<option value=" Tutorial">Tutorial</option>
<option value=" Technical Support">Technical Support</option>
<option value=" Html Issue">HTML Issue</option>
<option value=" WebMaster">WebMaster</option></select>
<br /> <br />
Your Comments' :<br />
<textarea name="notes" rows="5" cols="40"></textarea><br />
<input type="submit" value=" Send Mail " style="position: relative; left: 140px; bottom: 4px" />
<br />
</form>
<p> </p>
</div>
</body>
</html>
sendemail.php
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sending Email</title>
</head>
<body>
PHP Code:
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_['attn'];
if (eregi('http', $notes))
{
die ("Please Try Again!");
}
if (!$visitormail == "" && (!strstr($visitormail, "@") || !strstr($visitormail, ".")))
{ echo "<h2>Please Enter a Valid e-mail address</h2>\n";
$badinput = "<h2>FeedBack was not submitted!</h2>\n";
echo $badinput;
die ("Going Back! ");
}
if (empty($vistor) || empty($visitormail) || empty($notes))
{ echo "<h2>Required field\'s is left empty! </h2>\n";
die ("Please Try Again!"); }
$todayis = date("I, F j, Y, g:i a");
$attn = $attn;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n Concern: $attn \n Message: $notes \n From: $visitor ($visitormail) \n Additional info : IP = $ip \n Browser info: $httpagent \n Referral : $httpref \n";
$from = "From: $visitormail\r\n";
mail("info@rainarts.net46.net", $subject, $message, $from);
?>
<p align="center">
<?php echo $todayis ?>
HTML Code:
<br />
Thank You :
PHP Code:
<?php echo $visitor ?> ( <?php echo $ visitormail ?> )
HTML Code:
<br />
Concern:
PHP Code:
<?php echo $attn ?>
HTML Code:
<br />
Message:<br />
PHP Code:
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
PHP Code:
<?php echo $ip ?>
HTML Code:
<br /><br />
<a href="feedback.php"> H O M E </a>
</p>
</body>
</html>
That does it for all the codes'! I wonder which part of this code is generating those error! Waiting for kind reply... Tnx
Bookmarks