wsantos Posted January 6, 2008 Share Posted January 6, 2008 Well if this url : localhost/css/layout1.php Loads... then what should the url be for the include? Nope, thats what I have been saying... the html path to the file is different than the php path you have to define. if your linking to the file in HTML then yes /css/layout1.php will be correct for all files no matter where they live. But in PHP a file in /folder1/folder2/file.php cannot use the same path as a file that lives in the root /file.php /file.php would find the include calling it the way you did, but /folder1/folder2/file.php will not find the path as it will start looking in /folder1/folder2/<begin looking here> Nate I concur Quote Link to comment Share on other sites More sharing options...
thefollower Posted January 6, 2008 Author Share Posted January 6, 2008 Ok well when i tried your method it's still the same And i have error reporting on and no errors are shown. =/ Could it be my settings? Quote Link to comment Share on other sites More sharing options...
chronister Posted January 6, 2008 Share Posted January 6, 2008 in layout1.php put an echo statement in there and see if that echo statement shows through. I have had problems using XAMPP / WAMP with the error reporting not functioning correctly and when I add the ini_set line at the top of the page I get all my errors. you may not have error reporting set to a high enough level. if you have E_ERROR set, you will not get any notices, or warnings which can break the script depending on what the problem is. So I would try the ini_set method. Quote Link to comment Share on other sites More sharing options...
thefollower Posted January 6, 2008 Author Share Posted January 6, 2008 Whats the ini method? Ok here is the code as it is now: (picture attached below also) <?php error_reporting(E_ALL); include($_SERVER['DOCUMENT_ROOT'].'/css/layout1.php'); ?> <center> <?php Echo 'test'; ?> </center> <p> </p> <?php include($_SERVER['DOCUMENT_ROOT'].'/css/layout2.php'); ?> I have attached a picture to show you where the two layouts are [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
chronister Posted January 6, 2008 Share Posted January 6, 2008 The ini_set method I referred to is this.... ini_set('error_reporting', E_ALL); I have had issues with this way.. error_reporting(E_ALL); Try it like this.... <?php ini_set('error_reporting', E_ALL); include($_SERVER['DOCUMENT_ROOT'].'/css/layout1.php'); ?> Testing .... .this text should be seen <?php include($_SERVER['DOCUMENT_ROOT'].'/css/layout2.php'); ?> and lemme know what you get. Quote Link to comment Share on other sites More sharing options...
thefollower Posted January 6, 2008 Author Share Posted January 6, 2008 Ok ... it just worked :S LOL ! Although i really don't know how And thankyou for your time ! chronister ! And everyone else who chipped in to help! Let hope it remains working. Quote Link to comment 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.