How can I get my php mailer script to grab the value of a radio group?

Christopher

New member
My current mailer.php script works fine, but I'm updating my site and I can't figure out how to change my php script to pick out the answer (Value) of anything in a group. I'm using radio groups so the visitor can only pick one choice. Its the advertise with us form on armandocepeda.com
OK HERE IS MORE

one of my radio groups is this code
<label>
<input type="radio" name="adlocation" value="Main pages" id="chk4" />
Main pages</label>
<label><span class="hide" id="txtPrice5">5</span>
<input type="radio" name="adlocation" value="Sub pages" id="chk5" />
Sub pages</label>
<label>
<input type="radio" name="adlocation" value="Both" id="chk6" />
Both</label>
Ignore the id part thats needed for my order form total script.

but the php i know that would get that info is this

$adlocation_field = $_POST['adlocation'];

PROBLEM is that it has three adlocation's to choose from and adlocation1, adlocation2 and so on won't work because that would defeat the purpose of using a radio group allowing only one answer to that question.
 
here is an example radio group
<input type="radio" name="cheese" value="cheddar">
<input type="radio" name="cheese" value="stilton
<input type="radio" name="cheese" value="brie">
<input type="radio" name="cheese" value="roquefort">

if the form method is POST then the variable with the radio value is $_POST['cheese'] , if the form method is GET, then it is $_GET['get'] but its hard to say exactly because you didnt provide any of your code. so check your form method it looks something like

<form name="somename" method="post">
 
Back
Top