Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 5:14 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 3 posts ] 
Author Question
 Question subject: Beginner help on includes
PostPosted: Tue Jun 09, 2009 11:54 am 
Offline
Newbie
User avatar

Joined: Tue Jun 09, 2009 11:50 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time

I’m new to PHP and am just learning. At the moment, I’m playing around with various ways of constructing a web page to see what can and can’t be done, and how I might go about it.

I’ve got the hang of using simple includes to use a header and footer file.

This is the next step I’m trying out, and just want to know if it can be done or not, and if so, a short explanation (if there is one) would be appreciated, or pointing me to a tutorial would be great.

There’s two ideas I had to take the header and footer thing a step further, both using a shell which instead of including a header and footer, it included the page content. So, for example, I’d have a table, and in a cell, it would have an include command to pull the content from a different html/php file.

What I’m wondering whether it can be done or not is to do this almost backwards. So the file which would have the page shell, and where the include file for the content would be, it would have some kind of marker. Then the file with the content would call (include?) the web page shell, and have the content within that file that the web page shell would then put in the right place.

So you might have shell.php and content.php.

Content.php would have the content html in it, and would include shell.php at the beginning, but have some kind of marker before the html for the content that would identify the content to shell.php. So shell.php, when included) would match it to a marker in its own code, and put the content in the right place when rendering the page.

Does that make sense?

Again, I don’t know if this can be done, or if it’s a long winded way of doing something simple, etc. As I say I’m learning and experimenting at the moment, so I’m open to all suggestions!

I’m also happy to Google for a tutorial and even search the forum, but as you can tell by the long winded explanation, I don’t really know what search terms I would need to use to find what I’m looking for! (Same reason the thread title was so vague, so apologies for that too!)


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Beginner help on includes
PostPosted: Tue Jun 09, 2009 4:48 pm 
Offline
Newbie
User avatar

Joined: Tue Jun 09, 2009 11:50 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
OK, took me a fair bit of experimentation and 'out of the box' thinking, but I think I've worked out how to accomplish the same effect.

Job done!

:gOOd:


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Beginner help on includes
PostPosted: Wed Jun 10, 2009 12:14 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
you are talking about the skeleton of your application .
Header
Content .
Footer

The most used it to create a template that include all in one page . and changing the content page depending on some parameter ( Path of the page :ex :viewbody.php ) .

thanks

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 3 posts ] 
Quick reply


  

 Similar topics
 Need HELP- I am a beginner in Java
 Beginner needs help- simple 'mail_to' contact form in PHP
 I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER
 C# Programming for the Absolute Beginner

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team