Jump to content

I don't understand what is going on here!


Trium918

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.