| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Mar 2004 Location: Stockholm, Sweden
Posts: 4
![]() | |
| |
| | #2 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | place your menu into a html file say menu.html then where you want the nav on the page place this <? include("menu.html"); ?> it will then include the nav or have i misunder stood you and you to use one file with the website in it? if so i have a solution |
| |
| | #3 (permalink) |
| NamePros Member Join Date: Mar 2004
Posts: 111
![]() | or better yet, heres what i do... make up your site how you want it, and where you want the content to show up put this... <? if (file_exists("$id.php")) { include("$id.php"); } else { print("404 $id.php could not be located!"); } ?> then if say, you want to display music.php in the content area, then you would goto index.php?id=music |
| |
| | #4 (permalink) | ||||
| New Member Join Date: Mar 2004 Location: Edinburgh
Posts: 13
![]() |
i know the file it's looking for is on the server same directory as index.php but still no joy. any help appreciated (sp) ![]() Got it working at last ![]() Had to put - $dim = ($_REQUEST['id']); before the IF statement before it would work. ????: NamePros.com http://www.namepros.com/showthread.php?t=23949 -=Scozia=-
Last edited by Scozia; 03-19-2004 at 07:56 PM.
| ||||
| |
| | #5 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | theres a smoother way to do that using a switch statment PHP Code: |
| |
| | #6 (permalink) |
| Senior Member Join Date: Mar 2004 Location: Denton, Texas
Posts: 1,781
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | try this... PHP Code: links would be index.php?id=file1 to load file1.html, index.php?id=main to load main.html, etc |
| |