Jump to content

help with QUERY STRING


rod

Recommended Posts

hia,

anyway know what's the problem with the following code ?


<HTML><BODY>
  <div align=center>
  <A href="?page=1">Page 1</A> -
  <A href="?page=2">Page 2</A> -
  <A href="?page=3">Page 3</A>
  </div><hr>
<? switch($page) {
    case "1" :?>
Page 1
<? break; case "2" :?>
Page 2
<? break; case "3" :?>
Page 3
<? break; default:?>
Welcome
<?}?>
</BODY></HTML>

for reasons unknown, the quetystring doesn't seem to work with my web server ? is there any configuration settings that need changing ?

Rod
Link to comment
https://forums.phpfreaks.com/topic/36043-help-with-query-string/
Share on other sites

It would if you had register_globals set to on in your php.ini file. This is now set to off by default. It's good practice to use $_POST['var'] rather than $var for post variables and $_GET['var'] rather than $var for variables you pass in the url. I don't know how many times I have seen people fall into this trap.....

;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.