View Single Post
Old 11-26-2012, 12:02 PM   PM User | #1
countrydj
Regular Coder

 
Join Date: Nov 2011
Location: Preston, UK
Posts: 130
Thanks: 36
Thanked 0 Times in 0 Posts
countrydj is an unknown quantity at this point
How can I pick up two variables at the same time.

Hi Guys...
I have almost finidhed my cart, but I have a problem that I don'yt know how to code.
From the form:
PHP Code:
$output[] = '<tr>';  
$output[] = '<td align="center" colspan="2"><br><br><font color="#ff0000">Please select from the following</font></td>';   if ($row['accapproved'] == '1')  {
$output[] = '</tr>'
$output[] = '<tr height="30">'

$output[] = '<td align="center" colspan="2">On account: <input type="radio" name="delivery" value="account" />&nbsp;&nbsp;';
$output[] = '</td></tr>';
    }
$output[] = '<tr height="30">'
$output[] = '<td align="center" colspan="2">Cash on Delivery: <input type="radio" name="delivery" value="cash" />&nbsp;&nbsp;';
$output[] = 'Collect and Pay: <input type="radio" name="delivery" value="collect" /></td>';  
$output[] = '</tr>'
From the reeceiving page:
PHP Code:
$account="";  
if(isset(
$_POST['account'])){  
$account=$_POST['account'];
$account="Yes";
}  
$collect="";  
if(isset(
$_POST['collect'])){  
$collect=$_POST['collect'];
$collect="Yes";  
}  
$cash="";  
if(isset(
$_POST['cash'])){  
$cash=$_POST['cash']; 
$cash="Yes"

I know that I need to change the if(isset($_POST['cash'])) to if(isset($_POST['delivery']))
But the problem is that ALL the options are selected as YES.
I need to somehow select:
if(isset($_POST['cash'])) AND value = YES, in order to just select one.

I know that one solution would be to change from radio button to select box, but some idiot would select ALL options.

Can anybody advice me how to solve my problem ???

Thanks,
__________________
The MAN, The MYTH, The LEGEND:
John C
________________________________
Support your local Country Music Club
countrydj is offline   Reply With Quote