Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
snippets
.htaccess / mod_rewrite
404 header
Ajax response page
Basic HTTP Auth
Column display sans near-empty columns
JavaScript favelets/bookmarklets
misc php stuffs
php tricks
8
found
auth
Name:
Category: snippets
Body:
// Error display ini_set('display_errors', '1'); error_reporting(E_ALL | E_STRICT); error_reporting(-1); // report everything, forever // get current filename, see http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/ $me = basename($_SERVER['SCRIPT_FILENAME']); // setlocale Dutch: setlocale(LC_ALL, 'nl_NL.UTF-8', 'nl_NL'); // useful in strftime, others setlocale(LC_NUMERIC, 'en_US.UTF-8', 'en_US'); // (but let's use decimal point, not comma) // Detect whether FastCGI is running (for, say, the correct 404 header): if (stristr(php_sapi_name(), 'fcgi')) { header("Status: 404 Not Found"); }else{ header("HTTP/1.0 404 Not Found"); }
Footer