GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Yo how do I do a php include thingy? (https://gfy.com/showthread.php?t=277727)

Juicy D. Links 04-30-2004 05:37 PM

Yo how do I do a php include thingy?
 
Whats the code for this?

to include a snippet of juicy shit on evry page?

Ice 04-30-2004 05:38 PM

Don't ya got a book laying around on that subject guido?

Juicy D. Links 04-30-2004 05:39 PM

Quote:

Originally posted by iceicebaby
Don't ya got a book laying around on that subject guido?
yeah but i dont read any of them they are too thick and technical for me

lurking 04-30-2004 05:40 PM

PHP Code:

include("file.php"); 


Juicy D. Links 04-30-2004 05:40 PM

Quote:

Originally posted by lurking
PHP Code:

include("file.php"); 


thanks

fusionx 04-30-2004 05:42 PM

here's the real deal: http://us4.php.net/include/

and here's the quickie:

PHP Code:

<?php include 'http://www.example.com/file.php?foo=1&bar=2'?>

or

PHP Code:

<?php include 'file.php?foo=1&bar=2'?>

or

PHP Code:

<?php include '/sub/file.php?foo=1&bar=2'?>


Juicy D. Links 04-30-2004 05:42 PM

edit


can you use these on .shtml pages?

lurking 04-30-2004 05:50 PM

Quote:

Originally posted by juicylinks
edit


can you use these on .shtml pages?

no, that is SSI.

dirtysouth 04-30-2004 05:53 PM

also remember to go with the full path ie:
PHP Code:

<?php include('/home/sites/juicylinks.com/html/juicy.php'); ?>

*edit* as opposed to a url.

WallaceW 04-30-2004 05:55 PM

Quote:

Originally posted by juicylinks
edit


can you use these on .shtml pages?

Yes, but not by default.

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

lurking 04-30-2004 05:59 PM

Quote:

Originally posted by WallaceW
Yes, but not by default.

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

keep in mind if the page has a lot of traffic this will put a huge load on the server. it is much wiser to use .php or .phtml

WallaceW 04-30-2004 06:02 PM

Quote:

Originally posted by lurking
keep in mind if the page has a lot of traffic this will put a huge load on the server. it is much wiser to use .php or .phtml
Sure. It's just the way if you MUST run php in other then .php files.

lurking 04-30-2004 06:05 PM

also keep in mind it will disable SSI with .shtml

tgp-guru 04-30-2004 06:41 PM

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.

High Quality 04-30-2004 06:43 PM

Quote:

Originally posted by tgp-guru
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.
Good point... don't want them surfers knowing you fucked up.


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