EnriqueI Posted July 30, 2008 Share Posted July 30, 2008 Here is my code: <?php include("config.inc.php"); $ip = $_SERVER['REMOTE_ADDR'] ; $contactfname = $_REQUEST['contactfname'] ; $contactlname = $_REQUEST['contactlname'] ; $contacttitle = $_REQUEST['contacttitle'] ; $district = $_REQUEST['district'] ; $address = $_REQUEST['address'] ; //contact $city = $_REQUEST['city'] ; //contact $zip = $_REQUEST['zip'] ; //contact $contactphone1 = $_REQUEST['contactphone1'] ; $contactphone2 = $_REQUEST['contactphone2'] ; $contactphone3 = $_REQUEST['contactphone3'] ; $contactfax1 = $_REQUEST['contactfax1'] ; $contactfax2 = $_REQUEST['contactfax2'] ; $contactfax3 = $_REQUEST['contactfax3'] ; $contactemail = $_REQUEST['contactemail'] ; $Location = $_REQUEST['Location'] ; //ATTENDEE 1 $att1fname = $_REQUEST['1fname'] ; $att1lname = $_REQUEST['1lname'] ; $att1title = $_REQUEST['1title'] ; $att1email = $_REQUEST['1email'] ; $att1phone1 = $_REQUEST['1phone1'] ; $att1phone2 = $_REQUEST['1phone2'] ; $att1phone3 = $_REQUEST['1phone3'] ; $attfee1 = $_REQUEST['fee1'] ; //ATTENDEE 2 $att2fname = $_REQUEST['2fname'] ; $att2lname = $_REQUEST['2lname'] ; $att2title = $_REQUEST['2title'] ; $att2email = $_REQUEST['2email'] ; $att2phone1 = $_REQUEST['2phone1'] ; $att2phone2 = $_REQUEST['2phone2'] ; $att2phone3 = $_REQUEST['2phone3'] ; $att2fee = $_REQUEST['2fee'] ; //ATTENDEE 3 $att3fname = $_REQUEST['3fname'] ; $att3lname = $_REQUEST['3lname'] ; $att3title = $_REQUEST['3title'] ; $att3email = $_REQUEST['3email'] ; $att3phone1 = $_REQUEST['3phone1'] ; $att3phone2 = $_REQUEST['3phone2'] ; $att3phone3 = $_REQUEST['3phone3'] ; $att3fee = $_REQUEST['3fee'] ; //ATTENDEE 4 $att4fname = $_REQUEST['4fname'] ; $att4lname = $_REQUEST['4lname'] ; $att4title = $_REQUEST['4title'] ; $att4email = $_REQUEST['4email'] ; $att4phone1 = $_REQUEST['4phone1'] ; $att4phone2 = $_REQUEST['4phone2'] ; $att4phone3 = $_REQUEST['4phone3'] ; $att4fee = $_REQUEST['4fee'] ; //ATTENDEE 5 $att5fname = $_REQUEST['5fname'] ; $att5lname = $_REQUEST['5lname'] ; $att5title = $_REQUEST['5title'] ; $att5email = $_REQUEST['5email'] ; $att5phone1 = $_REQUEST['5phone1'] ; $att5phone2 = $_REQUEST['5phone2'] ; $att5phone3 = $_REQUEST['5phone3'] ; $att5fee = $_REQUEST['5fee'] ; // Billing Information $billfname = $_REQUEST['billfname'] ; $billlname = $_REQUEST['billlname'] ; $billagency = $_REQUEST['billagency'] ; $billaddress = $_REQUEST['billaddress'] ; $billcity = $_REQUEST['billcity'] ; $billzip = $_REQUEST['billzip'] ; $billphone1 = $_REQUEST['billphone1'] ; $billphone2 = $_REQUEST['billphone2'] ; $billphone3 = $_REQUEST['billphone3'] ; $billfax1 = $_REQUEST['billfax1'] ; $billfax2 = $_REQUEST['billfax2'] ; $billfax3 = $_REQUEST['billfax3'] ; // Other $payment = $_REQUEST['payment'] ; $checkamt = $_REQUEST['checkamt'] ; $pochecknum = $_REQUEST['pochecknum'] ; $updates = $_REQUEST['updates'] ; $subject = "$district Registration" ; $message = " CONTACT INFORMATION: Name: $contactfname $contactlname Title: $contacttitle District / Site: $district Address: $address, $city, $zip Phone Number: ($contactphone1)-$contactphone2-$contactphone3 Fax Number: ($contactfax1)-$contactfax2-$contactfax3 EMail: $contactemail Location: $Location =========================================== ATTENDEE INFORMATION: FIRST ATTENDEE: Name: $att1fname $att1lname Title: $att1title EMail: $att1email Phone Number: ($att1phone1)-$att1phone2-$att1phone3 Fee selected: $attfee1 SECOND ATTENDEE: Name: $att2fname $att2lname Title: $att2title EMail: $att2email Phone Number: ($att2phone1)-$att2phone2-$att2phone3 Fee selected: $att2fee THIRD ATTENDEE: Name: $att3fname $att3lname Title: $att3title EMail: $att3email Phone Number: ($att3phone1)-$att3phone2-$att3phone3 Fee selected: $att3fee FOURTH ATTENDEE: Name: $att4fname $att4lname Title: $att4title EMail: $att4email Phone Number: ($att4phone1)-$att4phone2-$att4phone3 Fee selected: $att4fee FIFTH ATTENDEE: Name: $att5fname $att5lname Title: $att5title EMail: $att5email Phone Number: ($att5phone1)-$att5phone2-$att5phone3 Fee selected: $att5fee =========================================== BILLING INFORMATION: Name: $billfname $billlname Agency: $billagency Address: $billaddress $billcity $billzip Phone Number: ($billphone1)-$billphone2-$billphone3 Fax Number: ($billfax1)-$billfax2-$billfax3 =========================================== PAYMENT OPTIONS: Payment Type: $payment Check Amount (If Applicable): $checkamt P.O. / Check Number: $pochecknum Opt in to future product updates? $updates ----------- Form Submitted from $ip " ; $headers = "From: $contactemail\n"; mail($address,$subject,$message,$headers); // @mail($address2, "$subject", "$message", "From: $email"); echo "<META http-equiv=\"refresh\" content=\"0; URL=$donepage\">"; ?> It goes through and refreshes to the donepage variable fine. No errors, nothing. This works on the same server: <?php $to = "[email protected]"; $subject = "PHP Is Great"; $body = "PHP is one of the best scripting languages around"; $headers = "From: [email protected]\n"; mail($to,$subject,$body,$headers); echo "Mail sent to $to"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/ Share on other sites More sharing options...
.josh Posted July 30, 2008 Share Posted July 30, 2008 post your form Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603231 Share on other sites More sharing options...
unidox Posted July 30, 2008 Share Posted July 30, 2008 Can I ask why your using $_REQUEST? Maybe register_globals is off, use $_POST or $_GET. Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603310 Share on other sites More sharing options...
EnriqueI Posted July 30, 2008 Author Share Posted July 30, 2008 post your form Could I message it to you? Can I ask why your using $_REQUEST? Maybe register_globals is off, use $_POST or $_GET. No clue... I'm not a coder. I kinda got this thrown on my plate. I will try $_POST Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603333 Share on other sites More sharing options...
cooldude832 Posted July 30, 2008 Share Posted July 30, 2008 if you didn't write this then how do u know how it works/fix it? secondly you have no clue if the mail() function is successful Thirdly your headers string is weak and probably is causing bounced messages Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603340 Share on other sites More sharing options...
EnriqueI Posted July 30, 2008 Author Share Posted July 30, 2008 if you didn't write this then how do u know how it works/fix it? secondly you have no clue if the mail() function is successful Thirdly your headers string is weak and probably is causing bounced messages 1). I did write it. I wrote the php side of it as a little project when I started exploring programming about 4 years ago. As you can see, I didn't follow it up much. (Obviously, I deleted the old variables and created new ones) 2). Not in the first script, no... but the second one does work. 3). Yes. But it will get bounced anyway... we have a barracuda spam filter that is pretty tight. I'm going to set the from address to something fairly random and whitelist it. Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603343 Share on other sites More sharing options...
EnriqueI Posted July 30, 2008 Author Share Posted July 30, 2008 $_POST instead of $_REQUEST did not work. Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603653 Share on other sites More sharing options...
EnriqueI Posted July 30, 2008 Author Share Posted July 30, 2008 Resolved. I had two variables named the same ($address)... And I went back and looked at the original form that I made, and it used $_POST, so I don't know where I got $_REQUEST from. Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603688 Share on other sites More sharing options...
PFMaBiSmAd Posted July 30, 2008 Share Posted July 30, 2008 $_REQUEST is not dependent on register_globals, but using $_REQUEST is a bad idea as they combine post/get/cookie variables. Should you add one of the other type variables but with a same index name that you are already using, for example adding a cookie on a different page of your site, your code will malfunction. If you are expecting external data to arrive in a specific variable use that specific variable, don't use $_REQUEST. Using $_REQUEST also makes it easier for a hacker to submit a series of values to your code as cookies or post data by simply putting them onto the end of the url as get parameters. Quote Link to comment https://forums.phpfreaks.com/topic/117268-any-idea-why-my-mail-script-isnt-working/#findComment-603777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.