Java script forms on my site - NOT WOKING


#1

I have several java script forms on my site.
Example: http://tocajuniors.com/club_toca_juniors_uniform_order_form.php
But when i filled the forms I get it blank
Any idea what is happening?
Thank you!!


#2

Your HTML form looks fine, so it seems likely that there’s an issue with the PHP script you’re using to process the form submission. Can you show us the code you’re using to extract the form variables from $_POST?


#3

[php]
$myemail = "info@tocajuniors.com";
$ccx = "perico75@hotmail.com";

if(!$visitormail == “” && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo “

Use Back - Enter valid e-mail

\n”;
$badinput = “

Feedback was NOT submitted

\n”;
}
echo $badinput;

$todayis = date(“l, F j, Y, g:i a”) ;

$attn = $attn . “Soccer Ball ordering process -” . $ccopy . “$fullname” ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Ref: $attn \n
Full Name: $fullname \n
Street Address: $address \n
City: $city \n
State: $state \n
Zipcode: $zipcode \n
Soccer Ball #3: $checkbox53 \n
Soccer Ball #4: $checkbox54 \n
Soccer Ball #5: $checkbox55 \n
Payment Paypal: $checkboxpaypal \n
Payment Check: $checkboxcheck \n
Primary Email: $email1 \n
Alternate Email: $email2 \n
Home Phone: $phone \n
Cell: $cell \n
Mail Message: $textarea \n
";

$from = “From: $email1\r\n”;

if (($ccopy == “ccyes”) && ($visitormail != “”))
mail($visitormail, $subject, $message, $from);

if ($myemail != “”)
mail($myemail, $subject, $message, $from);

if ($ccx != “”)
mail($ccx, $subject, $message, $from);

?>
[/php]


#4

Your email references a bunch of variables like “$attn”, but never sets them. It may have been written for older versions of PHP which automatically initialized variables from the request (i.e, register_globals). This option is no longer available with current versions of PHP, so you will need to initialize those variables explicitly, e.g.

[php]
$attn = $_POST[“attn”];
$fullname = $_POST[“fullname”];

$message = “

Ref: $attn\n
Full Name: $fullname\n

”;
[/php]


#5

Once you get that worked out you also have another problem.

The “From:” header is getting set here:

$from = "From: $email1\r\n";

searching upward to find out what $email1 has in it, I find:

Primary Email: $email1 \n

Which appears to be coming from a form field and should be containing the email address supplied by the user.

That will NOT work. That’s considered spoofing. You can’t send email “From:” hosts like gmail because your not gmail. (and that might be what the form filler supplied).

If the address in line 1 is a valid email address attached to your domain then change the first line I mention to:

$from = "From: $myemail\r\n";