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

Posted by Jeremy on 12/13/06 21:04

Curtis wrote:
> Use $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME']. Neither of these
> include the query string.
>

But neither of these will actually return the request URI; they will
only return the filename and/or path of the script.

Example:

..htaccess:
-----------------------
RewriteEngine On
RewriteRule ^foobar$ /foobar-script.php


foobar-script.php (accessed by URI /foobar)
-----------------------
<form action="<?=$_SERVER['PHP_SELF']?>">
<input type="text" />
<button type="submit">Submit</button>
</form>


Whoops! The form now submits to /foobar-script.php instead of /foobar.

Jeremy

 

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

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