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

Link to comment
Share on other sites

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.