PDA

View Full Version : Help with form script(nothing fancy Eric)


Kaos
Friday, May 9th, 2008, 04:49 PM
Umm, I apologize if Eric is the only coder in here, not really sure but I thought I'd ask. Trying to make a basic form just to ask people how they found a site but I am not recieveing it while I'm testing so obviously I coded it wrwong somehow..its php. Anyone have any ideas:

<?php
if ($_POST) {
if (get_magic_quotes_gpc()) {
foreach ($_POST as $key => $value) {
$temp = stripslashes($value);
$_POST[$key] = $temp;
}
}
$to = 'oxfordsupport@aol.com';
$subject = 'Feedback for DoTag';
//message goes here
$message = "foundation referal" . $_POST['textfield'] . "\n";
$message = "Other" . $_POST['11'] . "\n";
$message = "Search Engines" . $_POST['search engines'] . "\n";
$message = "Media" . $_POST['media'] . "\n";
$sent = mail($to,$subject,$message);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
if (isset($sent)) {
echo '<p><strong>Thank you for your feedback.</strong></p>';
}
?>
<form action=""post">
<p>We would love to know how do you here about us?<label></label><label></label>
</p>
<p> <br />
<label for="textfield">Foundation Website(please specify)</label>
<input name="textfield" type="text" id="textfield" tabindex="9" value="" />
<label></label>
<br />
<label><br />
</label>
<label for="11">Other</label>
<input type="text" name="11" id="11" tabindex="11" />
</p>
<p>
<label>
<input type="radio" name="How did you hear about us?" value="radio" id="search eninges" />
Search Engines</label>
<br />
<label>
<input type="radio" name="How did you hear about us?" value="radio" id="media" />
Media Coverage</label>
</p>
<p>
<label for="button"></label>
<input type="submit" name="button" id="button" value="Submit" />
<label></label>
<br />
</p>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>


:comp26::comp26::comp26::comp26:

esnagel
Friday, May 9th, 2008, 05:06 PM
I think you need to do this:

$sent = mail($to,$subject,$message, "From: someone@domain.com");

Kaos
Monday, May 12th, 2008, 11:09 PM
added that with no fix, did anything else pop out at you by chance?