Forum Moderators: coopster
I modified an example (called demoquery.php) at a French language site
[asp-php.net...]
which I think is designed to deliver different webpage content from within one file (depending on the value of the querystring). I couldn't get the example to work, so I tried changing it a little, eg using <?php
[2]<?[/2]
<A href="?page=1">Page 1</A> -
<A href="?page=2">Page 2</A> -
<A href="?page=3">Page 3</A>
</div><hr>
<?php
$page=$_GET['page'];
switch($page) {
case "1" :?>
page 1
<?php break; case "2" :?>
page 2
<?php break; case "3" :?>
page 3
<?php break; default:?>
default page
<?php }?>
but still no luck. So I wondered if anyone had any ideas? Thank you.
the examply you posted worked perfectly on my machine, running win2k/apache 2/php 4.2/mysql 4
so the code is correct.
you might have an older version of php, so try $HTTP_GET_VARS['page'] instead of $_GET['page']
you might like to read the manual on superglobals [es.php.net]
the user comments are useful
good luck