Re: @$_POST[...]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luke wrote:
2009/4/22 PJ <af.gourmet@xxxxxxxxxxxx>

Could somebody explain to me the meaning of @ in $var = @$_POST['title'] ;
where could I find a cheat sheet for those kinds of symbols or what are
they called?
Sorry for my ignorance, but maybe this will take the fog filter our of
my neurons. :-\
I believe placing an @ in front of a statement suppresses any error messages
it generates.


It does - in this case if 'title' is not posted as part of the form, it would have generated a warning or notice (can't remember which).

A longer path is:

$var = '';
if (isset($_POST['title'])) {
  $var = $_POST['title'];
}

The shortcut works but it makes it extremely difficult to find problems with your scripts (think of 50 @'s being used in one script.. eek).

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux