| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
css is for divs
Join Date: Feb 2003
Location: Norwich
Posts: 4,469
|
php includes for beginners links
I've been thinking about having a go at using PHP includes, I might also try ASP includes, I have no real preference as yet because I have pretty much no idea about either. But I do know that iframes are a bit poo, and includes seem to be the alternative of choice. I would be grateful for a reply that cover the basics, but suspect it might be a bit much to explain by threads so links for me to read are all good as well. I'm wondering about the real basics - do I need a database for this gubbins? TIA |
|
|
|
|
|
#3 (permalink) |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,527
|
Don't keep it a secret. PHP: Code:
You can use all sorts of includes (txt, htm, php etc) and to replace iframes just put it inside a div with your chosen overflow settings. |
|
|
|
#4 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,939
|
http://www.outfront.net/tutorials_02.../includes3.htm http://www.w3schools.com/php/php_includes.asp plenty plenty I personally prefer using PHP for various reasons, the main ones being that I know enough of it to get the task done and (therefore) using PHP for includes too fits in with existing PHP functions that I use. One note: When using PHP incudes you normally need to give the page containing the <?php include(…) ?> instruction a .php suffix. As the stick said, the included files themselves can have other suffixes. The rule being, that if a file contains <?php … ?> instructions, it needs to have the .php suffix in order to let the server know to pass the document through the php parser. |
|
|
|
#6 (permalink) |
|
Registered User
Join Date: May 2004
Posts: 6
|
also note that when you first try it, depending on your server's settings (in the php.ini file) you may have to include the full path from your server's root. (usually this is what spits out in your error message) so instead of: <?php include(someFile.txt); ?> you may need to use : <?php include(/some/path/to/your/incudes/someFile.txt); ?> and don't forget there's other functions like require(); the best place, in my opinion, to read about it is always the source: http://us4.php.net/manual/en/function.include.php |
|
![]() |