respecttheplayer Posted May 7, 2009 Share Posted May 7, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/ Share on other sites More sharing options...
sKunKbad Posted May 7, 2009 Share Posted May 7, 2009 You might take a look at your php.ini, and see if you are allowing yourself to open files via URL. Quote Link to comment https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/#findComment-828131 Share on other sites More sharing options...
respecttheplayer Posted May 7, 2009 Author Share Posted May 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/#findComment-828133 Share on other sites More sharing options...
respecttheplayer Posted May 7, 2009 Author Share Posted May 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/#findComment-828179 Share on other sites More sharing options...
PFMaBiSmAd Posted May 7, 2009 Share Posted May 7, 2009 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"); Quote Link to comment https://forums.phpfreaks.com/topic/157161-solved-include-php-4-vs-php-5/#findComment-828182 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.