Jump to content

help with radio buttons + php


nudude

Recommended Posts

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:

<tr>
<td colspan="5">
<?
if((isset($Submit)) && ($Submit=="Submit")) {
$mailto="email";
$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.="-------------------------------------------------------\n\n";
if($ShipmentMode)
{
$body.="Shipment Mode ". $ShipmentMode.": \n\n";
if(count($ToLease)>0)
{
for($i=0;$i<count($ToLease);$i++)
{
$body.=($i+1).". ".$ToLease[$i]."\n";
}
$body.="\n";
}
}
$body.=$Include;
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>";
}
?>&nbsp;</td>
</tr>



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.

Anybody?

Link to comment
Share on other sites

[code]
$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";
[/code]
Link to comment
Share on other sites

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.