Jump to content

Recommended Posts

I am trying to better understand why

(DOES NOT WORK)

else {
ob_start();
include("http://www.thegreatestsave.org/header.php");
}
?>

 

But when i remove the absolute path it does work

else {
ob_start();
include("header.php");
}
?>

 

Of course this is not practical if i want to use it for files in subfolders that are looking for header.php and it is not practical to upload header.php in every subfolder?

 

This is just a snippet of code but I am sure there is no need for more. I look forwarded to learning more about php5 since I just made the jump!

 

 

Link to comment
https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/
Share on other sites

Can i show my PHP Info, i just uploaded a file to my server, but I do not want to show everyone if it will make it a security risk? Also what do i look for in my .ini if you don't mind me asking. By the way just 1 hour ago my dedicated server was updated from PHP 4 to PHP 5 just a fyi.

Thanks sKunKbad, i called up my hosting company and had them access my php.ini file, for whatever reason owning a dedicated server i still did not have root access!!! But anyways after running a php info script and seeing that it was turned off i had them change it. Just to let everyone know in case this is referenced and helps someone, it was actually left off of the .ini file all together, for whatever reason they thought it was such a security risk that they deleted the line all together. I had them insert it back in and everything worked!!!

 

If anyone knows better practice for coding headers in subfolders than what i am doing i am all ears, but for now i got this figured out and hopefully some one will benefit from this.

 

Thanks so much.

Including a file using a URL causes php to make a HTTP request back to your web server, meaning each time you do this on a page it adds the amount of time it would take you to browse to the file being included.

 

If you include local files using a file system path, the include will occur a couple of orders of magnitude faster than using a URL.

 

You can form absolute file system paths using $_SERVER['DOCUMENT_ROOT'] to reference your document root folder -

 

include($_SERVER['DOCUMENT_ROOT'] . "/header.php");

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.