Need help with switches and links
Posted: Sun Oct 24, 2010 10:21 pm
Alright, Im trying to relearn php as it has been about a year or two since I actually used it and im a lil rusty with making links with switches on the page. I have heard rumors that the php5.x.x has broke the simplification of this. If this is true what is the best practice? saving links in arrays or variables? Could use some insight?'
Here is what Im messing with so far -
and here is the switch:
Thanks,
Gimpy
Here is what Im messing with so far -
Code: Select all
<div style="text-align:center">Home | <a href="<? =$_SERVER['PHP_SELF']; ?>?nav=time">Project 1</a>|
<a href="<? =$_SERVER['PHP_SELF']; ?>?nav=p2"> Project 2</a> | Project 3 | Project 4Code: Select all
switch ($nav) {
case "time":
//include '/projects/timeclock/index.php';
header('Location: /projects/timeclock/index.php');
break;
case "p2":
echo "i equals 1";
break;
case "p3":
echo "i equals 2";
break;
case "p4":
echo "i equals 2";
break;
default:
include 'home.php';
}
Gimpy