John_Saunders
11-01-2002, 07:53 PM
I am using includes with PHP call an external .php file that contains sublinks. There's like 6 different sections on my site and each section has different links that show up on the left side of the page.
For example, if you're on the About page you'll see links like, Contact, Resume, Location, etc. Then if you're at the Photos page you'll see links like, Cities, Nature, Friends, etc. I would like to make it so it will pull the correct file up when the visitor is at that section, with only having one call in my script.
Here's the code I'm using:
<?php include ("/home/login/public_html/includes/sub_SECTIONNAMEHERE.php"); ?>
How can I make it so instead of having to go in each file and changing it so it matches each section's links, it will detect which section it's on (maybe through the URL or something) then replace the filename with it and automatically find it in the includes directory? So if I change it to something like:
<?php include ("/home/login/public_html/includes/$section.php"); ?>
The includes directory would have something like:
about.php
photos.php
etc.
Any help would be greatly appreciated!
John
For example, if you're on the About page you'll see links like, Contact, Resume, Location, etc. Then if you're at the Photos page you'll see links like, Cities, Nature, Friends, etc. I would like to make it so it will pull the correct file up when the visitor is at that section, with only having one call in my script.
Here's the code I'm using:
<?php include ("/home/login/public_html/includes/sub_SECTIONNAMEHERE.php"); ?>
How can I make it so instead of having to go in each file and changing it so it matches each section's links, it will detect which section it's on (maybe through the URL or something) then replace the filename with it and automatically find it in the includes directory? So if I change it to something like:
<?php include ("/home/login/public_html/includes/$section.php"); ?>
The includes directory would have something like:
about.php
photos.php
etc.
Any help would be greatly appreciated!
John