Jump to content

Using Connect Files?


justlukeyou

Recommended Posts

Hi,

 

I have a script which uses a connect file but I am struggling to get files in other folders to read and for the "$loggedIn = checkLogin();" code to work.

 

If I connect to the database within the same script it works straight away.

 

If I change my password then I have to change every file but otherwise I cannot include the connect file as I have to link to it locally.

 

So if the connect file is in:

 

www.domain.co.uk/php/login/connect.php

 

then

 

www.domain.co.uk/php/login/index.php -- this works

 

www.domain.co.uk/php/logout.php -- this doesn't regardless of how I link to the connect file.

 

Link to comment
Share on other sites

In the file "login/index.php" I assume you have the code of..

require_once "connect.php";

 

In the file of "logout.php" you would need to alter the path to say..

require_once "login/connect.php";

 

Does this work?  If not then post some code and I'll take another look.

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.