Forum Moderators: coopster

Message Too Old, No Replies

Getting the URL inside an include

Returns the include url, i need the full url.

         

madmatt69

5:10 am on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey everyone,

I have an include that appears in my php page that has a form, and upon submitting the form I want it to take people to thepage.php?id=whatever for example.

However because the <? echo($_SERVER['REQUEST_URI']);?> is in my include file I get includefile.php?id=whatever.

Is there a way I can request the url of the page that the include is part of, and not the location of the include itself?

One way would be to preset the URL in a seperate variable, but there's gotta be a way to avoid that.

Thanks for any info!

madmatt69

3:10 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Any of you php guru's have an idea?

jatar_k

6:33 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try just outputting this

echo '<pre>';
print_r($_SERVER);
echo '</pre>';

and see which var contains what you need