PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You completely lost me. I'm taking a mssively large stab in the dark but are you do the "if" to see if $action exists, or to see if its value is true? You should be using isset() for the former.
I love stabbing at the dark also! I take it you are try to do a page navigation system.
First of all you would want to get the variable from the url (at least that is what I am guessing you are doing) and you would use something like this:
switch ($action) {
case 'a':
echo 'action a';
break;
case 'b':
echo 'action b';
break;
case 'c':
echo 'action c';
break;
default:
//this is the default action, this could be used as the error catcher
echo 'no action specified!';
}
switch($_SERVER['QUERY_STRING']) {
case 'first_link'':
echo "The name is $name";
break;
default:
echo"<a href='mypage.php?first_link&&name=John'>First Link</a>";
}
but the problem is it doest show the first link page when i click on the link!
switch($_SERVER['QUERY_STRING']) {
case 'first_link'':
echo "The name is $name";
break;
default:
echo"<a href='mypage.php?first_link&&name=John'>First Link</a>";
}
Have you noted the error? case 'first_link'': do you see the double single quotes at the end? Try it with out that and why you using $_SERVER['QUERY_STRING'] look at my example and use a variable either in the post or get arrays