OK, so I am reluctant to post this because when I searched the archives there were lots of comments from forum members about this subject being "already discussed multiple times".
But I can assure you I have looked at them all and still am not getting anywhere.
I want to create a .php contact form on the Contact page. I don't want flash. My host enables php content. Here is the code that I have been trying:
<?PHP
$to = "insert email here";
$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.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
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.";
}
?>
If I paste it into a placeholder under 'html code (body) and check 'Re-generate placeholder image automatically' it looks like script in a box.
I can paste this one and it looks normal:
<FORM name="form" action="/contactform/contactscript.php" method="post">
<TABLE cellSpacing="2" cellPadding="2" width="400" border="0">
<TBODY>
<TR>
<TD vAlign="top" align="right" width="200">Your Name: </TD>
<TD vAlign="top" align="left" width="200"><INPUT maxLength="200" size="25" name="name"> </TD></TR>
<TR>
<TD vAlign="top" align="right" width="200">Your Email: </TD>
<TD vAlign="top" align="left" width="200"><INPUT maxLength="100" size="25" name="email"> </TD></TR>
<TR>
<TD vAlign="top" align="right" width="200">Your Comments: </TD>
<TD vAlign="top" align="left" width="200"><TEXTAREA name="msg" rows="4" cols="25"></TEXTAREA> </TD></TR>
<TR>
<TD vAlign="top" width="200"></TD>
<TD vAlign="top" align="left" width="200"><INPUT type="reset" value="Reset" name="Reset"> <INPUT type="submit" value="Submit" name="Submit"> </TD></TR></TBODY></TABLE></FORM>
But it doesn't point anywhere.
in both cases, nothing is in the page <head>.
I downloaded other free contact form php scripts and pasted them into the placeholder html body and I still get a box with script in it.
So what am I doing wrong? Please?
John