Jump to content

Recommended Posts

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";
?>

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.

$_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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.