Trium918 Posted February 13, 2008 Share Posted February 13, 2008 I am getting a blank page, but if I comment require_once out Test Line outputs to the screen. I have not idea what is wrong here. Ok, I have require_once at the beginning of validate.php which is inside of DIR Login. The file that I am trying to include is up a level called mainfile.php, so I am using the following to include it. note: mainfile.php is in the root DIR. validate.php <?php require_once("../mainfile.php"); print "Test Line"; ?> ROOT File Structure: - mainfile.php - header.php - footer.php DIR login - login.php - validate.php Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/ Share on other sites More sharing options...
teng84 Posted February 13, 2008 Share Posted February 13, 2008 your error reporting i guess is off try to do this.. if(file_exists("../mainfile.php")){ echo 'yes'; }else echo 'no'; } Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466378 Share on other sites More sharing options...
Trium918 Posted February 13, 2008 Author Share Posted February 13, 2008 your error reporting i guess is off try to do this.. if(file_exists("../mainfile.php")){ echo 'yes'; }else echo 'no'; } Error Reporting is on! No Luck! Blank Page Still. Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466384 Share on other sites More sharing options...
schilly Posted February 14, 2008 Share Posted February 14, 2008 try including a different file. Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466403 Share on other sites More sharing options...
Trium918 Posted February 14, 2008 Author Share Posted February 14, 2008 try including a different file. Test.html was included into validate.php, so what could the problem be with all of the other files? <?php require_once("../test.html"); ?> Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466409 Share on other sites More sharing options...
defeated Posted February 14, 2008 Share Posted February 14, 2008 Hi, I'm new to all this... but have you tried ... instead of require_once("../mainfile.php"); putting in the whole address eg. "http://www.whatever.com/mainfile.php" Just had a look at what I have... it's like this.. include ('/home/j56789/public_html/header.php'); where j56789 is the user name provided by the host. And public_html is where my index lives. I saw something about using a php.ini file but could not find one on my server. with that you can point to all your includes and requires and then just have to input require_once("mainfile.php"); and it will find it no matter what folder level you are on. Hope that helps a little. Probably not though. Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466631 Share on other sites More sharing options...
richardw Posted February 14, 2008 Share Posted February 14, 2008 Along the lines of the last post, using a system path can work well. <?php $path = "/usr/local/www/vhosts/somepath/"; require_once("$path/db_inc.php"); print "Test Line"; ?> best Link to comment https://forums.phpfreaks.com/topic/90997-i-dont-understand-what-is-going-on-here/#findComment-466744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.