Jump to content

Archived

This topic is now archived and is closed to further replies.

nudude

help with radio buttons + php

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?

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.