|
Posted by BootNic on 11/22/07 18:38
"Beauregard T. Shagnasty" <a.nony.mous@example.invalid> wrote:
news:TBi1j.41100$if6.20699@bgtnsc05-news.ops.worldnet.att.net:
> BootNic wrote:
>
>> "Beauregard T. Shagnasty" wrote:
>>> <form id="frmcontact" method="post" action="<?php echo
>>> $_SERVER['PHP_SELF']?>">
>>
>> $_SERVER['SCRIPT_NAME'] would be a better option over
>> $_SERVER['PHP_SELF']
>
> I see they return identical results. Is there a reason you think
> SCRIPT_NAME is better? I'm willing to listen, though I've been using
> PHP_SELF for many years.
They may return the same results under some conditions.
Jonathan has given a link for more information. He has also given an
example in another thread
[url]
http://groups.google.com/group/alt.html/browse_thread/thread/91253a1c3a5844
ff [/url]
[url] http://groups.google.com/group/alt.html/msg/b6e9aebddbae21b3 [/url]
> http://us3.php.net/reserved.variables
>
> 'PHP_SELF'
> The filename of the currently executing script, relative to the
> document root. For instance, $_SERVER['PHP_SELF'] in a script at the
> address http://example.com/test.php/foo.bar would be
> /test.php/foo.bar. The __FILE__ constant contains the full path and
> filename of the current (i.e. included) file.
>
> 'SCRIPT_NAME'
> Contains the current script's path. This is useful for pages which
> need to point to themselves. The __FILE__ constant contains the full
> path and filename of the current (i.e. included) file.
http://example.com/test.php/foo.bar would return
/test.php
--
BootNic Thursday November 22, 2007 1:38 PM
Behind every successful woman...is a basket of dirty laundry.
*Sally Poe*
Navigation:
[Reply to this message]
|