note 84077 added to function.session-name
| From: | webmasteratnncodersdotde at osu1 dot php dot net | Date: | Thu, 26 Jun 2008 16:29:03 +0000 |
| Subject: | note 84077 added to function.session-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140845@lists.php.net to get a copy of this message | ||
You can always just use "or".
@foo or bar();
When foo fails, (and the at still means don't print an error to the browser), the function bar
will be executed.
<?php
function errorhandler () { /* do something wild */ }
@session_name('mysession') or errorhandler();
?>
Another live example would be
@mysql_query('show databases') or die(mysql_error());
When the execution fails, parameter die is called (with last mysql_error as given string parameter)
----
Server IP: 217.160.72.57
Probable Submitter: 80.141.82.60
----
Manual Page -- http://www.php.net/manual/en/function.session-name.php
Edit -- https://master.php.net/note/edit/84077
Del: integrated -- https://master.php.net/note/delete/84077/integrated
Del: useless -- https://master.php.net/note/delete/84077/useless
Del: bad code -- https://master.php.net/note/delete/84077/bad+code
Del: spam -- https://master.php.net/note/delete/84077/spam
Del: non-english -- https://master.php.net/note/delete/84077/non-english
Del: in docs -- https://master.php.net/note/delete/84077/in+docs
Del: other reasons-- https://master.php.net/note/delete/84077
Reject -- https://master.php.net/note/reject/84077
Search -- https://master.php.net/manage/user-notes.php