note 116715 added to function.phpinfo

From: Date: Mon, 16 Feb 2015 08:09:26 +0000
Subject: note 116715 added to function.phpinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-201736@lists.php.net to get a copy of this message
Building on SimonD's elegant example to hide the logged-in username and password, which otherwise appear in plain text, the following should work for PHP 5.4+: <?php // start output buffering ob_start(); // send phpinfo content phpinfo(); // get phpinfo content $html = ob_get_contents(); // flush the output buffer ob_end_clean(); // remove auth data if ( isset( $_SERVER[ 'PHP_AUTH_USER' ] ) ) $html = str_replace( $_SERVER[ 'PHP_AUTH_USER' ], '[ protected ]' , $html); if ( isset( $_SERVER[ 'PHP_AUTH_PW' ] ) ) $html = str_replace( $_SERVER[ 'PHP_AUTH_PW' ], '[ protected ]' , $html); echo $html; ?> To remove additional items, just add them as above. ---- Server IP: 72.52.91.14 Probable Submitter: 96.250.100.171 ---- Manual Page -- http://php.net/manual/en/function.phpinfo.php Edit -- https://master.php.net/note/edit/116715 Del: integrated -- https://master.php.net/note/delete/116715/integrated Del: useless -- https://master.php.net/note/delete/116715/useless Del: bad code -- https://master.php.net/note/delete/116715/bad+code Del: spam -- https://master.php.net/note/delete/116715/spam Del: non-english -- https://master.php.net/note/delete/116715/non-english Del: in docs -- https://master.php.net/note/delete/116715/in+docs Del: other reasons-- https://master.php.net/note/delete/116715 Reject -- https://master.php.net/note/reject/116715 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201736) next »