Jump to content

Zany form issue


scottyd

Recommended Posts

Ok, I am really baffled by this so any ideas or input anyone can give me would be great.

 

I have a from that is built in HTML and on submit to goes to the php page to send the mail from the form.

 

The crazy thing is that when i fill out the form, and hit submit, it processes the from just fine with out any errors, but never sends anything.

 

BUT...

 

if I refresh the php page, it sends the mail form perfectly.

 

I have no idea what could be causing that.

 

Here is the php code that I have:

 

<?php
$sendTo = "[email protected]";
$subject = "Office Materials Request Form";
$headers = "From: " . $_POST["Requested_By"] ."<" . $_POST["Email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Content-type: text/html; charset=us-ascii";
$message = "<b><u>Office Materials Request Form</u></b> <br><br> \r\n";
$message .= "<b>Requested By:</b> ". $_POST["Requested_By"]."<br>\r\n";
//$message .= "Email: ". $_POST["email"]."\r\n";
$message .= "<b>Department:</b> ". $_POST["Department"]."<br><br>\r\n";
$message .= "Large Post Its: ". $_POST["Large_PostIt"]."<br>Quantity: ". $_POST["Large_PostIt_Quantity"]."<br><br>\r\n";
$message .= "Small Post Its: ". $_POST["Small_PostIt"]."<br>Quantity: ". $_POST["Small_PostIt_Quantity"]."<br><br>\r\n";
$message .= "Legal Pads: ". $_POST["Legal_Pad"]."<br>Quantity: ". $_POST["Legal_Pad_Quantity"]."<br><br>\r\n";
$message .= "Black Pens: ". $_POST["Black_Pen"]."<br>Quantity: ". $_POST["Black_Pen_Quantity"]."<br><br>\r\n";
$message .= "Green Pens: ". $_POST["Green_Pen"]."<br>Quantity: ". $_POST["Green_Pen_Quantity"]."<br><br>\r\n";
$message .= "Red Pens: ". $_POST["Red_Pen"]."<br>Quantity: ". $_POST["Red_Pen_Quantity"]."<br><br>\r\n";
$message .= "Blue Highlighter: ". $_POST["Blue_Highlighter"]."<br>Quantity: ". $_POST["Blue_Highlighter_Quantity"]."<br><br>\r\n";
$message .= "Green Highlighter: ". $_POST["Green_Highlighter"]."<br>Quantity: ". $_POST["Green_Highlighter_Quantity"]."<br><br>\r\n";
$message .= "Pink Highlighter: ". $_POST["Pink_Highlighter"]."<br>Quantity: ". $_POST["Pink_Highlighter_Quantity"]."<br><br>\r\n";
$message .= "Yellow Highlighter: ". $_POST["Yellow_Highlighter"]."<br>Quantity: ". $_POST["Yellow_Highlighter_Quantity"]."<br><br>\r\n";
$message .= "Large Binder Clips: ". $_POST["Large_Binder_Clips"]."<br>Quantity: ". $_POST["Large_Binder_Clips_Quantity"]."<br><br>\r\n";
$message .= "Medium Binder Clips: ". $_POST["Medium_Binder_Clips"]."<br>Quantity: ". $_POST["Medium_Binder_Clips_Quantity"]."<br><br>\r\n";
$message .= "Small Binder Clips: ". $_POST["Small_Binder_Clips"]."<br>Quantity: ". $_POST["Small_Binder_Clips_Quantity"]."<br><br>\r\n";
$message .= "Staples: ". $_POST["Staples"]."<br>Quantity: ". $_POST["Staples_Quantity"]."<br><br>\r\n";
$message .= "Tape: ". $_POST["Tape"]."<br>Quantity: ". $_POST["Tape_Quantity"]."<br><br>\r\n";
$message .= "Other Info: ". $_POST["Other"]."\r\n";



mail($sendTo,$subject,$message,$headers);
?>

 

I am not too sure if it's because I have register_globals off in php.ini

But if I enable them, the form doesn't send at all, even after refreshing the php page.

 

So, yeah. I am stumped. Not sure if it's a php.ini config thing, or i need to re-work the code.

If you need anymore info, let me know thanx!

 

P.S. - I know the form is long.  I just whipped it up.  I plan on making more of it in javascript later on, but I gotta get the darn thing to send first.

Link to comment
https://forums.phpfreaks.com/topic/119540-zany-form-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.