Jump to content


help with radio buttons + php

  • Please log in to reply
1 reply to this topic

#1 nudude

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 23 June 2006 - 08:47 AM

Hi. I'm new here and need help about this online form I'm doing. I know this is basic stuff but since I'm not really a programmer, I couldn't understand some of the php samples I've come across.

Anyways, I used this php code from a previous form done by someone else and trying to revise it to include some radio buttons. I'd like to have the radio buttons options selected to display in the email when submitted.

Here's the code:

<td colspan="5">
if((isset($Submit)) && ($Submit=="Submit")) {
$subject="Online inquiry submission from website";
$body="Full Name: ".$FullName."\n";
$body.="Company: ".$Company."\n";
$body.="Company Address: ".$CompanyAddress."\n";
$body.="Contact Phone Number 1: ".$ContactPhoneNumber1.="\n";
$body.="Contact Phone Number 2: ".$ContactPhoneNumber2."\n";
$body.="Mobile Phone Number: ".$MobilePhoneNumber."\n";
$body.="Fax Number: ".$FaxNumber."\n";
$body.="E-mail Address: ".$EmailAddress."\n";
$body.="Shipment Mode: ".$ShipmentMode."\n";
$body.="Shipper: ".$Shipper."\n";
$body.="Consignee: ".$Consignee."\n";
$body.="Port of Loading: ".$PortofLoading."\n";
$body.="Port of Discharge: ".$PortofDischarge."\n";
$body.="Place of Delivery: ".$PlaceofDelivery."\n";
$body.="ItemCommodity: ".$ItemCommodity."\n";
$body.="Quantity: ".$Quantity."\n";
$body.="Measurement: ".$Measurement."\n";
$body.="Gross Weight: ".$GrossWeight."\n";
$body.="Rate Idea: ".$RateIdea."\n";
$body.="Additional Remarks: ".$AdditionalRemarks."\n\n";
$body.="Shipment Mode ". $ShipmentMode.": \n\n";
$body.=($i+1).". ".$ToLease[$i]."\n";
mail($mailto,$subject,$body,"From: ".$EmailAddress."\r\n"."Reply-To:". $EmailAddress);
echo "<div align=\"center\" class=\"msg\"><strong>Your inquiry has been sent! Thank you!</strong></div>";

The ones with radio buttons are in:

Shipment: 0 Sea 0 Air
Port of Loading: 0 Port 0 Door
Port of Discharge: 0 Port 0 Door

The part: if($ShipmentMode) is just an experiment based on the original php but it doesn't work. (Not surprising)

So far the data in the text fields are displaying properly (no problem there). It's the radio buttons that I'm totally clueless.


#2 jvrothjr

  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 23 June 2006 - 12:22 PM

$body.="Shipper:    ";
        "<input type=radio name=Shipper value='Sea'>Sea";
        "<input type=radio name=Shipper value='Air'>Air\n";
$body.="Consignee:    ".$Consignee."\n";
$body.="Port of Loading:    ";
        "<input type=radio name=PortofLoading value='Port'>Post";
        "<input type=radio name=PortofLoading value='Door'>Door\n";
$body.="Port of Discharge:    ";
        "<input type=radio name=PortofDischarge value='Port'>Port";
        "<input type=radio name=PortofDischarge value='Door'>Door\n";
$body.="Place of Delivery:    ".$PlaceofDelivery."\n";

If you understand everything you know nothing!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users