I'm going to take your posts one at a time, and the second post is going to be long as I'm going to include the html and php from my index page, and an example page that would be called as an include.
Quote:
Originally Posted by Silvy
Ok, I had this really long response ready, and I re-read your post to see wether I got all your questions, and I got confused
Let's try to narrow down the issues a little
index.php builds general page layout plus 1 of 3 things (load $id.jpg, load $id.php, load brewerysplash.jpg) correct?
$id.php does what exactly? (and is it the same for every $id? i.e. brewery.php, stable.php, garage.php)
(does it just echo a single image, or does it create buttons, or other stuff?)
|
Index.php is the template page. It is what is seen at
www.arch13.com . It's the backround, navigation, etc. It's all built with html and css, it's just a php file to allow it to be parsed for the include script that includes the footer copyright and the main window content. It's the frame that displays in other words. You are right that it will do one of the three mentioned based on the url variables and if id=blah is a php or jpg file.
I like that functionality, and it took a while to figure it out with lots of help. The else is just to put something (brewerysplash.jpg) up should they try to request something that does not exist.
$id.php is whatever plaintext file I'm displaying in the templates content area. if you go to my front page, where brewerysplash.jpg is, that is the "content area". The point has always been seperating content from display. That way, many different types of content can be placed in that box based on what I want the viewer to see. Conversly, I can change the template, and not have to edit or change any of the included files.
There are areas where we get complicated. In my portfolio for example. Index.php calls p_gallery into the content area using $id, and then p_gallery call's portfolio_gal.php through $id2 to build the thumbnail table. In this case, $id and $id2 have othing to with one another besides doing similar actions (calling in another file via include)
Quote:
In order to try to answer some questions for you:
- Can you call $_REQUEST['id2'] from within included files: yes
- Can you call variables from index.php from within included files: yes
- Can you disguise $_REQUEST['id2'] as $_REQUEST['id']: NO, or at least you shouldn't (but you can pass $id to the included files...)
- Is it better to split the files or build one big index.php? I don't know
(see my next post)
Hope this will settle some questions, so we can get to the good stuff
|
The feeling I got was this. Right now index.php has the first $id php script in it's content area box. I need that to always work, regardless of what the included page has in it's coding. $id is how I choose what file to display there. $id2 is what I use when the included page also needs to include something.
I'm not trying to disguise on as the other.
I'm currently calling $_REQUEST['id2'] from the included file I caled using $id if I understand your first list point
Can I use the $id variable from the index page in the included pages php script? That's what I was trying to ask in less well phrased questioning.
So, On to the actual markup of index.php and brewery.php as maybe that will help you understand what I'm asking instead of me babbling
