|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
i have my index page set up with the menu like this:
<? switch ($page) { case "guide": include('guide/guide.inc'); break; case "bands": include('db/index.php'); break; case "ticks": include('ticks/ticks.php'); break; case "chat": include('bands/bands.php'); break; default: include('content.php'); } ?> when i click on "guide" it loads guide.inc into the browser within the index page, bit like a iframe tag, now on the guide.inc page i have another seperate menu. my prob is this, when i click on a menu item in the guide.inc page the index page defualts back to the content.php, i want it to be able to load it within the index page. guide.inc search || whatshot || lastweek || <--guide.inc menu the links are set up like this: a href="index.php?page=search.php" etc etc... basically i want it to act a bit like the iframe tag i hope this makes sence..please help! thanx |
|
#2
|
|||
|
|||
|
just pass an extra argument with your url's.
So if u're on 'guide', all links (search, whatshot, etc) have an extra argument...'page' So you links should look liks this (or like it...) : a href="index.php?page=guide&subpage=search.php" Yoy could drop the '.php' extention in a switch struc on the guide-page if you like. Good luck |
|
#3
|
|||
|
|||
|
Your problem is that a Url like this: href="index.php?page=search.php" is going to hit your code:
PHP Code:
The above code is going to find that there is no search.php in the switch statement so it will go to the default include('content.php'); What you can do is, make the link: href="index.php?page=guide&sub=search" Now all you have to do is create another switch statement inside guide.inc. PHP Code:
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#4
|
|||
|
|||
|
..i think i allready told....
![]() i also think u should use the following implementation switch(trim($page)) { // $_GET['page'] is even way better! case(guide): etc.... On the 'sub'-pages u could use a switch again if u like ![]() |
|
#5
|
|||
|
|||
|
Yes, our explainations were similar... I just thought I would elaborate a little in case our friend needed a little more detail.
Also, you are right about using the superglobal arrays. If diamondazza wants to find out more about that topic it would be a good idea to check out this thread: http://www.devarticles.com/forum/sh...=&threadid=4391 |
|
#6
|
|||
|
|||
|
..or by reading this nice story
![]() |
|
#7
|
|||
|
|||
|
Yeah, it doesn't get any better than that.
|
|
#8
|
|||
|
|||
|
i have posted this same question all around the web.. you guys are the only ones to give me a good answer with links to tutorial pages!! im workin on my web page now with what you lot have said! if it works ill buy yas all a drink!! im pretty lame at php, cant seem to get my head around it, great to know theres help here!
cheers guys |
|
#9
|
|||
|
|||
|
No problem... hope it works out for you. If not we are always here to help.
|
|
#10
|
|||
|
|||
|
*sigh*
well...i set it all up, used superglobals and all it seem to do is reload that poxy defualt content!! is there any other way i could code the menu? i understand what you guys were tellin me but ARGH!! so...i think its beer oclock!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > internal php navigation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|