Current url

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This might be the dumb one for the day but, I need a PHP function (or
whatever) similar to the JavaScript "self.location" in PHP.

Will someone please put me out of my misery.


Re: Current url

Quoted text here. Click to load it

Look at the header() function in the php documentation.  A call like
header("Location: ") will cause an
instant redirect to that page.

If you want the script to know the URL of the page that called it, use
the predefined variable $_SERVER[] - see

For example, $_SERVER['PHP_SELF'] in a script at the address would be /mypage.php/etc

Hope that helps. -A

Re: Current url

On May 2, 5:46 pm, (axlq) wrote:
Quoted text here. Click to load it

Thank you very much

Re: Current url

ft310 schreef:
Quoted text here. Click to load it

Be aware that $_SERVER['PHP_SELF'] can be tweaked (since it contains GET  
parameters), thus if you want to be safe you should not use it for  
generation of <form action='"'>...

Tim Van Wassenhove - Read my mind <url:

Site Timeline