![]() |
Yo how do I do a php include thingy?
Whats the code for this?
to include a snippet of juicy shit on evry page? |
Don't ya got a book laying around on that subject guido?
|
Quote:
|
PHP Code:
|
Quote:
|
here's the real deal: http://us4.php.net/include/
and here's the quickie: PHP Code:
PHP Code:
PHP Code:
|
edit
can you use these on .shtml pages? |
Quote:
|
also remember to go with the full path ie:
PHP Code:
|
Quote:
There are several ways to do that, but my fav is to make an .htaccess file in the directory where you want your .shtml pages with executable php. In that .htaccess put this: AddType application/x-httpd-php .php .shtml From then your .shtml will be treated as PHP also... Regards |
Quote:
|
Quote:
|
also keep in mind it will disable SSI with .shtml
|
Use require() instead of include(). If the file to be included is not found require() dies whereas include() gives just an error message. Also with older versions of php (< 4 i think) require would always assume to include the file on compilation whereas include would be subject to runtime conditionals.
|
Quote:
|
All times are GMT -7. The time now is 06:10 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123