You are not getting $_GET['question']
back.
You are getting q1
back. So what you have made will have a url like:
Result.php?q1=a&g=Go"
So you have to set your Result.php at
$q=$_GET["q1"];
if($q)
{
switch($q)
{
case 'a': print "question 1";
break;
}
}
If you want your url to have question insted you need to do it like this:
<form method="GET" action="Result.php">
<b>Question 1. What is the full form of PHP?<b> <br>
A)<input type="radio" name="question1" value="a">
Pre HyperText Processor<br>
B)<input type="radio" name="question1" value="b">
Post HylerText Processor<br>
C)<input type="radio" name="question1" value="c">
Personal HyperText Pages<br>
D)<input type="radio" name="question1" value="d">
HyperText Preprocessor<br>
<input type="submit" name="g" value="Go">
Keep in mind that this is a quick fix but do not use GET. Use POST insted.
Also use FireBug to see how you get or post forms.
EDIT
It's better to use POST otherwise it will overwrite your url.
Try this and let me know if it's what you want.
<html>
<head>
<title>Question 1</title>.
</head>
<body>
<form method="POST" name="form" action="Result.php?question=1">
<b>Question 1. What is the full form of PHP?<b> <br>
A)<input type="radio" name="q1" value="a">
Pre HyperText Processor<br>
B)<input type="radio" name="q1" value="b">
Post HylerText Processor<br>
C)<input type="radio" name="q1" value="c">
Personal HyperText Pages<br>
D)<input type="radio" name="q1" value="d">
HyperText Preprocessor<br>
<input type="submit" name="g" value="Go">
</form>
</body>
Result.php
<?php
$q=$_GET["question"];
if($q)
{
$PostedValue = $_POST['q1'];
switch($PostedValue)
{
case 'a': echo "Pre HyperText Processor";
break;
case 'b': echo "Post HylerText Processor";
break;
case 'c': echo "Personal HyperText Pages";
break;
case 'd': echo "HyperText Preprocessor";
break;
}
}
?>
OR if you want to use Method GET you can pass it through a hiddin input:
And you can use your own Result.php code.
<html>
<head>
<title>Question 1</title>.
</head>
<body>
<form method="GET" name="form" action="Result.php">
<input type="hidden" name="question" value="1">
<b>Question 1. What is the full form of PHP?<b> <br>
A)<input type="radio" name="q1" value="a">
Pre HyperText Processor<br>
B)<input type="radio" name="q1" value="b">
Post HylerText Processor<br>
C)<input type="radio" name="q1" value="c">
Personal HyperText Pages<br>
D)<input type="radio" name="q1" value="d">
HyperText Preprocessor<br>
<input type="submit" name="g" value="Go">
</form>
</body>