Jump to content

Path problem..


bugzy

Recommended Posts

I have this problem on my path and I'm confused on what to use among relative, document or root relative path. I'm doing this on my local machine so absolute path is not in the option..

 

 

All my admin pages are on a folder named "ADMIN"

 

I have this

 

 

function for my session

 

<?php 

session_start(); 


function logged_in()
{
return (isset($_SESSION['member_id']) || isset($_COOKIE['member_id']));
}


function confirm_logged_in()
{
if(!logged_in())
{

	me_redirect_to('login.php');
}
}


?>

 

 

 

the problem here is on the line me_redirect_to('login.php');

 

Since my I'm calling the fucntion on all admin pages.. it will keep on saying that

The requested URL /prac/admin/login.php was not found on this server.

 

It's adding the folder on the url where the admin pages is located.. it's supposed to be only

 

/prac/login.php

 

 

Anyone?  :shrug:

Link to comment
Share on other sites

../login.php ?

 

xyph problem with that is, I'm going to also use that function on other files that are located on different root level including the files that are located on the root. So I'm looking for a solution that will cover all files regardless of where their locations are..

Link to comment
Share on other sites

../login.php ?

 

xyph problem with that is, I'm going to also use that function on other files that are located on different root level including the files that are located on the root. So I'm looking for a solution that will cover all files regardless of where their locations are..

 

Well, you're either going to have to use absolute paths (you SHOULD be, the Location header spec requires an absolute URI), or your're going to have to calculate where your executing page is in relation to the root.

 

http://php.net/manual/en/function.header.php#refsect1-function.header-notes

HTTP/1.1 requires an absolute URI as argument to ? Location: including the scheme, hostname and absolute path, but some clients accept relative URIs.
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.