You are here: Re: Current url « PHP Programming Language « IT news, forums, messages
Re: Current url

Posted by Tim Van Wassenhove on 05/03/07 14:40

ft310 schreef:
> On May 2, 5:46 pm, a...@spamcop.net (axlq) wrote:
>> In article <1178140660.159901.169...@e65g2000hsc.googlegroups.com>,
>>
>> ft310 <tooh...@fullchannel.net> wrote:
>>> 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.
>> Look at the header() function in the php documentation. A call like
>> header("Location:http://example.com/mypage.php?etc") 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[] - seehttp://us.php.net/manual/en/reserved.variables.php
>>
>> For example, $_SERVER['PHP_SELF'] in a script at the addresshttp://example.com/mypage.php?etcwould be /mypage.php/etc

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:http://www.timvw.be/>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация