Form Mail Script Giving Me Hell

I will post in its entirety.. long form!

Page 1 of 1

3 Replies - 1366 Views - Last Post: 04 November 2003 - 07:55 AM Rate Topic: -----

#1 Sphearion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 02

Form Mail Script Giving Me Hell

Posted 03 November 2003 - 10:14 PM

Ok here is the thing.. I have written this to take orders online, I just need it to email me the answer's, I will format the email better later, I just need to get it working... any suggestions, code rewrites will be incorperated and proper credit given! --- HELP PLEASE! 2 days on this and still not working so I came to the pros!

<html>
<head>
<title>Video Racing Order Form</title>
</head>

<body>

<form name="order" method="post" action="order.php?action=email">
<table border="0" cellpadding="4">
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_organization_id0">Renter (Organization)</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_organization_id0" name="organization"
maxlength="100">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_name_id0">Your Name</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_name_id0" name="name" maxlength="55">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_saddress1_id0">Shipping Address 1</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_saddress1_id0" name="saddress1"
maxlength="50">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_saddress2_id0">Shipping Address 2</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_saddress2_id0" name="saddress2"
maxlength="50">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_DayPhone_id0">Daytime Phone</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_DayPhone_id0" name="DayPhone"
maxlength="14">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_evePhone_id0">Evening Phone</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_evePhone_id0" name="evePhone"
maxlength="14">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_eventdate_id0">Event Date</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_eventdate_id0" name="eventdate"
maxlength="20">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_returndate_id0">Required Date of Return</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_returndate_id0" name="returndate"
maxlength="20">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_people_id0">How many people will be attending
attending</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_people_id0" name="people"
maxlength="3">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="chkbx_basic_id0">Basic Package ( covers up to
100 guests) $295.00</label><input type="checkbox" id="chkbx_basic_id0"
name="basic" value="Basic" title="Basic Package ( covers up to 100 guests)
$295.00"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="chkbx_extend_id0">Package extension ( covers
extra 75 guests) $50.00</label><input type="checkbox" id="chkbx_extend_id0"
name="extend" value="extend" title="Package extension ( covers extra 75
guests) $50.00"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="chkbx_place_id0">Place/Quinella Betting (
$25.00 )</label><input type="checkbox" id="chkbx_place_id0" name="place"
value="placebet" title="Place/Quinella Betting ( $25.00 )"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">Would you like VIDEO RACING to schedule a UPS
pickup</td>
  <td align="left"><label for="radbtn_pickup_id0">yes</label><input
type="radio" id="radbtn_pickup_id0" name="pickup" value="yes"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_pickup_id1">no</label><input
type="radio" id="radbtn_pickup_id1" name="pickup" value="no"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">
   <label for="txtInp_nonprofit_id0">If you are a Missouri non-profit
organization, enter tax exempt number here</label>
  </td>
  <td align="left">
   <input type="text" id="txtInp_nonprofit_id0" name="nonprofit"
maxlength="15">
  </td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">What house Percentage the you would
like:</td>
  <td align="left"><label for="radbtn_percentage_id0">0%</label><input
type="radio" id="radbtn_percentage_id0" name="percentage"
value="0%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_percentage_id1">10%</label><input
type="radio" id="radbtn_percentage_id1" name="percentage"
value="10%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_percentage_id2">20%</label><input
type="radio" id="radbtn_percentage_id2" name="percentage"
value="20%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_percentage_id3">30%</label><input
type="radio" id="radbtn_percentage_id3" name="percentage"
value="30%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_percentage_id4">40%</label><input
type="radio" id="radbtn_percentage_id4" name="percentage"
value="40%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_percentage_id5">50%</label><input
type="radio" id="radbtn_percentage_id5" name="percentage"
value="50%"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">Horse Races or Dog Races</td>
  <td align="left"><label for="radbtn_horsedog_id0">Horse </label><input
type="radio" id="radbtn_horsedog_id0" name="horsedog"
value="Horse"></td>
 </tr>
 <tr valign="top">
  <td align="left" width="40%">&nbsp;</td>
  <td align="left"><label for="radbtn_horsedog_id1">Greyhound</label><input
type="radio" id="radbtn_horsedog_id1" name="horsedog"
value="Greyhound"></td>
 </tr>
</table>
<input name="Submit" type="submit" id="Submit" value="Send
Order"></form> 
</form>
</body>
</html>

<?

$to = "orders@videoracinginc.com,dreaminb@dreaminbinary.net";
$subject = "Order from Videoracinginc.com"; 
$extra = "From: $name\r\nReply-To: $Contact\r\n"; 
$first =  $organization . $name . $saddress1 . $saddress2 . $dayphone . $evephone . $eventdate . $returndat . $people . $basic . $extend . $place . $pickup . $nonprofit . $percent . $horsedog
    if($action == email) { 
        mail($to, $subject, "message from:" $extra, $REMOTE_ADDR , $first); 
        }; 
?>



Is This A Good Question/Topic? 0
  • +

Replies To: Form Mail Script Giving Me Hell

#2 MathewS  Icon User is offline

  • D.I.C Regular

Reputation: 18
  • View blog
  • Posts: 343
  • Joined: 14-May 02

Re: Form Mail Script Giving Me Hell

Posted 04 November 2003 - 04:57 AM

easy matey.

you need to edit this
if($action == email) { 
       mail($to, $subject, "message from:" $extra, $REMOTE_ADDR , $first); 
       }; 



to this

if($action == "email") { 
       mail($to, $subject, "message from:" $extra, $REMOTE_ADDR , $first); 
       }; 



you were missing the "
Was This Post Helpful? 0
  • +
  • -

#3 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1875
  • View blog
  • Posts: 20,282
  • Joined: 17-March 01

Re: Form Mail Script Giving Me Hell

Posted 04 November 2003 - 07:08 AM

Good Catch!
Was This Post Helpful? 0
  • +
  • -

#4 Sphearion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 02

Re: Form Mail Script Giving Me Hell

Posted 04 November 2003 - 07:55 AM

ALL DONE.. I have it all fixed and working thanks anyway guys
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1