Problem with setting a Relative Path

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
jdhorton77
Forum Commoner
Posts: 56
Joined: Tue Nov 07, 2006 3:29 pm
Location: Charlotte, NC

Problem with setting a Relative Path

Post by jdhorton77 »

I'm using PHP Session Variables and I had my href tags using absolute paths. But for some reason it wasn't allowing the Session Variables to pass from page to page correctly. So I'm wanting to try relative paths since I think when I use the absolute path it is creating a new session. Problem is that the server I'm using has a directory for http and https. So for a file found in the http directory the absolute path would be http://something.com/somefile.php. And for a file in the https directory it would be https://something.com/someotherfile.php. My problem is when I have a file in the https directory trying to include a file in the http directory I'm not sure how to write the relative path. I've tried many different ways but to no avail. Could someone please help. Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're including a file via a remote request? The file is local to the script, is it not?

PHP typically doesn't care one way or another if you're in HTTPS over HTTP. It will act the same.

If you output getcwd(), it may illustrate a remarkable similarity.
Post Reply