Jump to content

PHP Server Path Confusion!


akshay

Recommended Posts

Hello.

 

I've noticed this strange path problem.

 

While programming on a PHP server, the path is always '/' (default directory), even if your pages are located in /directory/subdir

 

Example, I had put <iframe src="/ifr_marquee/"></iframe> on the page present in 'web' dir. as: /web/index.php

 

As per the logic, the path of iframe picked by PC should be: /web/ifr_marquee

 

however, it picks /ifr_marquee from 'main' directory. and I'll have to specify full path, i.e. /web/ifr_marquee to tell the server about location of directory.

 

Why is that so? had the page extension been HTML, everything would have worked fine, then why with PHP?

 

Also, other files present in /web/ folder had ../xyz/ (i.e. xyz in main directory).

 

Does that mean ../xyz in a directory, on PHP server = /xyz ?

 

I know, I'm not being very clear.

I just want to know why it happens? And Can it be overcome with include_path() ?

 

Thank you! :)

Akshay

Link to comment
https://forums.phpfreaks.com/topic/193638-php-server-path-confusion/
Share on other sites

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.