Help with switch/case statement navigation

Reply

Join Date: Oct 2006
Posts: 164
Reputation: Barefootsanders is an unknown quantity at this point 
Solved Threads: 3
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Help with switch/case statement navigation

 
0
  #1
Mar 31st, 2007
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.
  1. <?php
  2. switch ($Content)
  3. {
  4. case register:
  5. echo "<a href=\register.php</a>";
  6. break;
  7. default:
  8. echo "Welcome to our online game!";
  9. }
  10. ?>

And this is the link that would go to the register page.
  1. <tr><td colspan="2" align="left"><br>Not registered? <a href="<?php echo $_SERVER['PHP_SELF']; ?>?Content=register">Sign-Up!</a></td></tr>
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!
Last edited by Barefootsanders; Mar 31st, 2007 at 7:59 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Help with switch/case statement navigation

 
0
  #2
Apr 1st, 2007
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]
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 164
Reputation: Barefootsanders is an unknown quantity at this point 
Solved Threads: 3
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Re: Help with switch/case statement navigation

 
0
  #3
Apr 1st, 2007
ahh that worked. Thanks a bunch
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC