I made this simple radio group below but I’m having some difficulty calling it in PHP.
<form id="form1" name="form1" method="get" action="pre_process.php">
<p>
<input name="q" type="text" size="80"/>
</p>
<p>
<input type="submit" id="search_button" />
</p>
<p>
<label>
<input type="radio" name="SearchFormat" value="0" id="SearchFormat_0" />
Agreggated</label>
<br />
<label>
<input type="radio" name="SearchFormat" value="1" id="SearchFormat_1" />
Non-Aggregated</label>
I’m using the following code but I get an error of undefined index: SearchFormat
if($_GET["SearchFormat"]==0)
{
do stuff...
Can somebody tell me what I’m doing wrong?
Thanks
Just see at your browser, May be there is possibility that you are running your code by direct from folder . But you have to run your page with localhost address.
Look at the code below.
This is First PHP file: radio.php
Now another PHP file is:test1.php
You have to run this PHP file by writing localhost/radio.php at the browser.
Second php file than automatically runs as you click on SearchFormat button.
And also one thing you have to save your all php page in WAMP/XAMP folder.