I can’t quite figure out what’s wrong here.
[code=php]
if(isset($_POST[‘submit’])||isset($_POST[‘submit’])) {
$selected_radio = $_POST[‘response’];
if ($selected_radio == ‘Page1’) {
header(“url=http://localhost/Test/Page1.php”); }
elseif ($selected_radio == ‘Page2’) {
header(“url=http://localhost/Test/Page2.php”); }
elseif ($selected_radio == ‘Page3’) {
header(“url=http://localhost/Test/Page3.php”); }
elseif ($selected_radio == ‘Page4’) {
header(“url=http://localhost/Test/Page4.php”); }
}
And here is my HTML Form :
[code=html]
<form name=”Testing” action=”test.php” method=”post”>
<input type=”radio” name=”response” Value=”Page1″>Page1
<br>
<input type=”radio” name=”response” Value=”Page2″>Page2
<br>
<input type=”radio” name=”response” Value=”Page3″>Page3
<br>
<input type=”radio” name=”response” Value=”Page4″>Page4
<br>
<input type=”submit” name=”submit” value=”Please Select”>
When I select a radio button, all I get is re-directed to a BLANK page (the URL in the blank page shows : [B][url]http://localhost/Test/test.php
Meaning, I am going nowhere.
I can’t figure out what the issue is.
I even inserted an [B]ECHO
[code=php]if ($selected_radio == ‘Page1’) {
echo “SELECTED PAGE 1” ;
header(“url=http://localhost/Test/Page1.php”); }[/code]
And, I got the ECHO. It showed on the blank screen.
But I was not re-directed to the URL I gave.
I tried to change the URL to the following format : [B]header(‘Location : [url]http://localhost/Test/Page1.php
Still nothing.
Any idea what the issue could be ?
Thanks