[PHP] relative url and path_info

2012-09-30 Thread Tom Sparks
I have created a php script that use $_SERVER['PATH_INFO'], for the different sub-sections the links now looks like this http://localhost/collection/popups.php/models/bttf/car01/    my web browser cant load my images/javascripts/etc because it is trying to use  relative url from http://localho

Re: [PHP] Relative Url

2004-04-02 Thread Chris Shiflett
--- Chris Thomas <[EMAIL PROTECTED]> wrote: > I working on creating a poll script, and right now it consists of 3 > main files: > poll.php > pollFunctions.php > poll.css > These files reside in the /poll directory (for now) [snip] > So what im trying to figure out is the relative url of where the

Re: [PHP] Relative Url

2004-04-02 Thread Red Wingate
Ok found his one on some old libs of mine, guess this should work but i am not sure : function find_relativ_path( $origin , $target ){ $append = ''; $string = ''; $origin = explode('/',$origin); $target = explode('/',$target); unset($origin[(count($origin)-1)]); uns

Re: [PHP] Relative Url

2004-04-02 Thread Red Wingate
Hi chris, Haven't much time now but maybe you can find a way with those ideas: in pollFunctions.php do : $pollFunctions_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ ); in foo.php do : $foo_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ ); Now you just have to compute the diff

Re: [PHP] Relative Url

2004-04-02 Thread Chris Thomas
What im trying to do is this. I working on creating a poll script, and right now it consists of 3 main files: poll.php - Which does the server-side processing pollFunctions.php - Which draws the poll and does some client side stuff poll.css- stylesheet These

RE: [PHP] Relative Url

2004-04-01 Thread Rick Fletcher
> Is there anyway that i can get a url relative to my server > for a script that is being run?? > > The script is being included in mulitple files and > $_SERVER['SCRIPT_NAME'] just gives me the name of the file > that is including the other scripts. > Also $_SERVER['SCRIPT_FILENAME'] is return

Re: [PHP] Relative Url

2004-04-01 Thread Chris Shiflett
--- Chris Thomas <[EMAIL PROTECTED]> wrote: > Is there anyway that i can get a url relative to my server for a > script that is being run?? $relative_url = '/'; That's a relative URL to your document root. What are you wanting, exactly? Chris = Chris Shiflett - http://shiflett.org/ PHP Sec

[PHP] Relative Url

2004-04-01 Thread Chris Thomas
Is there anyway that i can get a url relative to my server for a script that is being run?? The script is being included in mulitple files and $_SERVER['SCRIPT_NAME'] just gives me the name of the file that is including the other scripts. Also $_SERVER['SCRIPT_FILENAME'] is returning nothing. Tha