Unable to add PHP Manual Note.

From: Date: Tue, 18 Dec 2007 07:07:10 +0000
Subject: Unable to add PHP Manual Note.
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-692@lists.php.net to get a copy of this message
Dear Sir / Madam, I tried to post PHP manual note on http://docs.php.net/manual/add-note.php. But the error is "Your IP is listed in one of the spammers lists we use, which aren't controlled by us. More information is available at http://www.dnsstuff.com/tools/ip4r.ch?ip=59.95.29.176." But the fact is that I am using BSNL Broadband 2MBPS connection in which the IP is alloted by the ISP. Every time I start my PC I will be connected to internet through BSNL DSL network India. When I clicked above link I shocked to here that this IP (Which is dynamically alloted by my ISP which is not in my hand). I wanted to contribute following code to PHP manual. The code is as below: --------------------------------------------------------------------------------------------------------- This comprehensive php code used to keep your valuable CSS and JavaScript Files unreachable to client side. This code loads CSS Data and JavaScript code directly into browser's memory but not be downloaded to client side. If user tries to get code by entering file URI into the browser, it will not allow to download to client side. This is very effective way to keep css and javascript files secret. No way CSS and JavaScript Files are viewable to users but loads directly to browser's memory. The code is: ====== [ index.php file ]======= <?php ob_start(); //This will turn output buffering on session_name('js_css_auth'); // set exclusive session name for css and javascript session_start(); //start the session $_SESSION['allow_css_js'] = true; //allow CSS and JavaScript Files through php only $_SESSION['css_file'] = "../css/secret_css.css"; //CSS file location, this location is unknown to the user $_SESSION['js_file'] = "../scripts/secret_js.js"; //JavaScript file location, this location is unknown to the user $css_path = "./include/load_data.php?type=css&next=true&js_css_auth=" . session_id(); //note next=true variable $js_path = "./include/load_data.php?type=js&next=false&js_css_auth=" . session_id(); //note next=false variable //after passing next=false, session for CSS and JavaScript will be destroyed //please set next=false for last CSS or JavaScript file to be loaded into memory // following doctype is not concerned with the code ?> <head> <link rel="stylesheet" type="text/css" media="screen,projection,print" href="<?echo $css_path ?>" /> <script language="JavaScript" src="<?echo $js_path ?>" type="text/javascript"></script> <title>Thakares Infotech, Aurangabad (Maharashtra - India) CSS keep secret!</title> </head> <!-- Global IE fix to avoid layout crash when single word size wider than column width --> <!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]--> <body> <h3>If you see "T" Big Capital then...CSS</h3> <div id="cap">T</div>ested OK.. <br/><br /> <p><a href="Javascript:show_msg('Secret JavaScript File Loaded');">Click here to test Javascript</a> </body> </html> =========[end of index.php file ]======== ========[ load_data.php file ]========== <?php session_name('js_css_auth'); //select CSS and JavaScript session session_start(); $flag = (boolean) isset($_SESSION['allow_css_js']) && $_SESSION['allow_css_js']; // check whether request is through sessions only $next = (boolean) isset($_GET['next']) && $_GET['next'] === "true"; //check for last file if (isset($_GET['type']) && $flag) { $file_type = trim($_GET['type']); switch($file_type) { case 'css' :{ // for css file $datafile = $_SESSION['css_file']; header("Content-type: text/css; charset=UTF-8"); //send headrs break; } case 'js' : { // for JavaScript File $datafile = $_SESSION['js_file']; header("Content-type: text/javascript; charset=UTF-8"); //send headrs break; } default : { die(); } } // end of switch $content=file_get_contents($datafile); echo $content; // this will print data to browser's memory if (!$next) { // Unset all of the session variables. $_SESSION = array(); ob_end_flush(); // Finally, destroy the session. session_destroy(); } } else { echo "<h1>You are not allowed to see Our CSS / JavaScript Files!</h1>"; // display message is user tries to get code via URI exit(0); } ?> ========[ end of load_data.php file ]========== -------------------------------------------------------------------------------------------------------- kindly go through the code If you still feel that the code is worth to be included to Contributor note, kindly requested. Sunil Thakare.

« previous php.webmaster (#692) next »