Hello all
Thanks for reading...
I am a student and must update a php-controlled website. I am starting to understand it quite good, but there's still a problem with the website, and of course...the owner of it doesn't feel happy if that site still won't work for another two weeks.
So I hope there's someone willing to help me out, because the people I asked at school won't reply. Too busy with other things.
The problem is about the SWITCH function. Let me enter the code first.
<?
include "includes/head.php";
if(!isset($p)) $p=1;
switch ($p) {
case 1:
include "includes/page1.php";
break;
case 2:
include "includes/page2.php";
break;
case 3:
include "includes/page3.php";
break;
case 4:
include "includes/page4.php";
break;
}
include "includes/foot.php";
?>
Now this is a site where there are several buttons which should link to the files page1.php to page4.php. As you might understand :p . Obvious, when you enter the site, you will automatically go to page1.php. But when you click on the button 'History' you will go to www.firedepart.nl/?p=2 which should trigger the switch function at CASE 2. Then of course, page2.php should be included.
But this does not work. I still get page1.php. And when I change the code (page1.php to page3.php) I get page3.php at the start, so the code is definately working. But I think when the link of 'History' goes to www.firedepart.nl/?p=2, the code doesn't see that p=2 so refuses to go to CASE 2.
Hopefully you understand me as a newbie.
Thanks for your attention!
Regards,
Maarten / MeanRat