Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

PHP includes help

  • Please log in to reply



    New Member

  • Member
  • Pip
  • 1 posts
Ok, I'm going to try to explain this as clearly as I can...

I am structuring a little handful of PHP pages for an assignment.

I'm currently working with includes, and creating master templates for particular pages.
This is where it gets difficult for me to explain.

I want to create 3 different types of master template, and I want to display 2 instances of each type. In my master templates, I am calling various includes from all around my file system, and they work perfectly... on the first instance which is the folder's index page.
Now, I create a folder alongside the main index page and create in this new folder, its own index page. I do this because I don't want the URL to end with the file extension in the browser.
I want these two index pages - a level apart - to be 2 instances of 1 master template.
The problem is that now that these 2 files are a folder apart, the master template won't work. Not because it's being called incorrectly, but because all the includes within the master template are being called incorrectly.

The quick and easy fix would be to abandon the folder and just put up with the file extension, but I don't want to do that. Plus, if there's a way of getting around this, it would be helpful to learn anyway.
I was wondering if there was a way I could run a program to find includes and put a ../ on the front or something... I don't know much about PHP.

Thanks in advance!
  • 0




    New Member

  • Member
  • Pip
  • 8 posts
Instead of using different index files maybe a better way would be to use $_GET method? www.youwebsite.com/index?page=pagename
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP