Howdy~
I was wondering I have the following code and php but the code does not let me put a space in the city (like Johnson Creek) and wondering why the php is not emailing me? Both worked before and all of a sudden they stopped working.
[code]
<form action=”http://mydomain.info/mailer.php” onsubmit=”return require (this)”>
<fieldset> <legend><font color=”#FFFFFF”><b> Submit Message Here To The
Troops </b></font></legend><b><font color=”#FFFFFF”><label>First Name
<input name=”name” type=”text” onchange=”if (!/^[a-z]*$/i.test(this.value)) {alert(); this.value = ”; this.focus()}”>
</label><label>City
<input name=”city” type=”text” onchange=”if (!/^[a-z]*$/i.test(this.value)) {alert(); this.value = ”; this.focus()}”>
</label> <label>State
<input name=”state” type=”text” onchange=”if (!/^[a-z]*$/i.test(this.value)) {alert(); this.value = ”; this.focus()}”>
</label> <label>Message
<textarea name=”message” rows=”10″ cols=”30″></textarea>
</label> <button type=”submit”>Submit</button> </font></b></fieldset>
</form>
[code=php]
<?PHP
$to = “[email protected]”; #set address to send form to
$subject = “Subject”; #set the subject line
$forward = 0; # redirect? 1 : yes || 0 : no
$location = “”; #set page to redirect to, if 1 is above
$date = date (“l, F jS, Y”);
$time = date (“h:i A”);
$msg = “Below is a message of test. It was submitted on $date at $time.nn”;
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);
if ($forward == 1) {
header (“Location:$location”);
}
else {
echo “Test<br>test!”;
echo'<br><a href=”/somepage”>Test</a>’;
}
?>
Thanks
The Devil