Okay…
As you can tell I am not big on S/S Scripting. I have a simple hyperlink to popup window (annoying, but works with clients wishes), that is meant to collect Name, Email, and Address. Mail those to a coworker. Simple.
Problem is, it only grabs the contents of the Address text area, not the name and the email feilds. Here is the HTML/PHP. Any help would be great, I am stumped.
Thanks!
FORM CODE:
<div id="divTwo">
<span class="text">
Name:
<br>
Email:
<br>
Address:
</span>
</div>
<form action="email.php" method="post">
<? if ($message != "") {
print '<span class="errortext">'.
$message."<span><br>
";
}
?>
<input name="name" class="texta" type="text" value=""><br>
<input name="email" class="texta" value="" type="text"><br>
<textarea class="texta" name="address" rows="5" cols="30" Value=""></textarea><br>
<input name="process" value="1" type="hidden">
<input name="submit" value="Submit" id="submit_btn" type="submit">
</form>
PHP (Located above the header, file is .PHP)
<?
$emailclass = "basictext";
$username = "";
$name = $_POST['name'];
$address = $_POST['address'];
$subject = "Customer Address Data";
$to = "garth@allyvideo.com";
$body = "From: $name_field
E-Mail: $email_field
Address:
$address";
if ($_POST['process'] == 1) {
$pattern = '/.*@.*\..*/';
$email = $_POST['email'];
$urlname = urlencode($$_POST['username']);
if (preg_match($pattern, $_POST['email']) > 0) {
// Here's where you would store
// the data in a database...
header(
"location: thankyou_form.html");
mail($to, $subject, $body);
}
else {
header(
"location: incomplete.html");
}
}
?>