This is a discussion on relative paths and get variables within the PHP General forums, part of the PHP Programming Forums category; Hi I am currently developing a site and I came across a weird behaviour which I just cannot understand: The ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
I am currently developing a site and I came across a weird behaviour which I just cannot understand: The whole thing was working and I could include files from other directories using relative paths with or without passing variables and whatever the method. I implemented a cookie. It would not work unless I used ob_start( ); (I am still not sure why - anyway) Now the cookie works but I get the following puzzling error: Say I am checking something and if it's wrong, I want to display an error message. I use a nice error file: include("../error.php"); This works except I want to tell it which error to print so I use include("../error/error.php?error=access"); for example. And this does not work anymore but produces the error: Warning: main(): Failed opening '../errors/error.php?error=access' for inclusion (include_path='.:/usr/lib/php') in ...blah. I could get around it having a separate file for each error but that's not the point, now is it?.... :) And I need to pass variables to other files too anyway! I have checked my php.ini settings and the pwd is included so I should have no problems with relative paths. It looks like the argument to the php file (?error=access) is interpreted as part of the filename but why would that not happen before I used a cookie? What would a set_cookie and ob_start have to do with apache/zend's interpretation of a filenames? Any help would be greatly appreciated as I'd rather understand what's going on than just dropping the problem... :) Thanks a lot! C |