You are here: Re: action="<?=$PHP_SELF?>"> « PHP Programming Language « IT news, forums, messages
Re: action="<?=$PHP_SELF?>">

Posted by zoilus on 06/06/07 22:39

Uneducated perhaps, but

3 a : weak in intellect : FOOLISH b : exhibiting or indicative of a lack
of common sense or sound judgment <a very silly mistake>

Ouch. ;)


Rik wrote:

> On Thu, 07 Jun 2007 00:03:09 +0200, zoilus <zolius@someplace.org> wrote:
>
>> I had been trying this one and a few others without success, until I
>> used this
>>
>> // $PHP_SELF=$_SERVER['PHP_SELF']; //r&d
>> // print "$PHP_SELF"; //r&d
>>
>> The above worked while others just blanked my php output.
>
>
> Some pointers:
>
> - Never ever use the <?=$varname ?> syntax. (Which assumes both
> shorttags and register_globals set to On, both of which are a Bad Idea)
>
> - Do not expect any magic variable to exist except the ones listed on
> http://www.php.net/manual/en/language.variables.predefined.php (well,
> including $this in classes etc.)
>
> Also, putting double quotes around a single variable to echo, print, or
> do anything else with it is just plain silly. All it does is it casts
> it to a string, which is already assumed by echo/print constructs. If
> you really need to cast it to a string, using strval() (only for
> scalars) or (string)$varname is preferred. See
> http://www.php.net/manual/en/language.types.type-juggling.php for more
> details on this.
>
>
> Short answer:
> <?php echo $_SERVER['PHP_SELF']; ?> works almost all the time,
> depending on what webserver you use (as it isn't provided by PHP
> itself, the server tells PHP what it should 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

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