| | |
Help with switch/case statement navigation
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 164
Reputation:
Solved Threads: 3
Hey everyone. I'm trying to create a webpage where everything you click, it reloads in the main content div with the new page. Heres an example of what im talking about.
This is my main content.
And this is the link that would go to the register page.
I know I'm not implementing the switch/case statement correctly (otherwise it would be working lol) But if someone could show me how to make it reload the center div on each click?? Thanks!
This is my main content.
PHP Syntax (Toggle Plain Text)
<?php switch ($Content) { case register: echo "<a href=\register.php</a>"; break; default: echo "Welcome to our online game!"; } ?>
And this is the link that would go to the register page.
PHP Syntax (Toggle Plain Text)
<tr><td colspan="2" align="left"><br>Not registered? <a href="<?php echo $_SERVER['PHP_SELF']; ?>?Content=register">Sign-Up!</a></td></tr>
Last edited by Barefootsanders; Mar 31st, 2007 at 7:59 pm.
Does the server you are working on have register_globals = on ? If not (and its more secure if register_globals is off) then you will need to get the $content variable like so:
[PHP]$Content = $_GET['Content'];[/PHP]
also register should be in quotes like so:
[PHP]case 'register':[/PHP]
[PHP]$Content = $_GET['Content'];[/PHP]
also register should be in quotes like so:
[PHP]case 'register':[/PHP]
![]() |
Similar Threads
- switch statement on String in Java (Java)
- switch case (C)
- Switch Case Statement (Java)
- switch/case statement (C++)
Other Threads in the PHP Forum
- Previous Thread: Can someone pls translate this
- Next Thread: Unexpected parse error, I dont know what I'm doing wrong.
| Thread Tools | Search this Thread |
301 access apache api array beginner binary broken button cakephp checkbox class clean cms code countingeverycharactersfromastring crack cron curl database date decode directory display dissertation dropdown dynamic echo email error fairness file files folder form forms function functions google href htaccess html image include insert integration ip javascript joomla limit link login mail match md5 menu methods mlm multiple mysql newsletters oop pageing pagerank paypal pdf php problem protocol query radio random recursion remote script search secure server sessions simple sms soap source space spam sql syntax system table tutorial update upload url validator variable video virus votedown web youtube





