Im new to PHP and I face a problem of value passing. 🙁
Im using Apache 2.0 with PHP4
Please look at following coding :
<html>
<body>
<?php
if ($id) {
if ($id=="1") { Printf("Green Color<br>"); }
else { Printf("Yellow Color<br>"); }
} else
{
printf("<a href=\"%s?id=%s\">%s</a><br>\n",$PHP_SELF,"1","Select Color 1");
printf("<a href=\"%s?id=%s\">%s</a><br>\n",$PHP_SELF,"2","Select Color 2");
}
?>
</body>
</html>
Save as color.php
When open it from browser IE 6 using Address http://localhost/color.php
it shows following result with link :
Select Color 1
Select Color 2
When I click on "Select Color 1"
Address become ---> http://localhost/color.php?id=1
But the browser still showing me following result :
Select Color 1
Select Color 2
It should show "Green Color"
Meaning browser unable to get the value for $id
What could be the problem ? Can anyone help ? 😕
My Email Address : soon5773@yahoo.com