Posts

Showing posts from November, 2013

Affiliates


Detect if page is on iframe and direct it on your page.

Image
Detect if webpage is on iframe and redirect it on your page. this prevent viewing your site on proxies that sometimes steals data from your users. the code informs that parent web if on iframe results to replace the location page toString which is the main web on iframe. pop-up text < script > parent . frames . length && top . location . replace ( document . location . toString ()); </ script > <script> parent.frames.length&&top.location.replace(document.location.toString()); </script>

Emergency Survival Kit

Image
A Perfect tools needed for emergency situation on an environmental catastrophe.

PHP Chat with AJAX

Image
PHP chat is a most common as these days with the help of AJAX  I share to you my basic scripts with autorefresh at first you need to have localhost server or any web site hosting that supports php. these are my scripts Create file for your chat display ex. response.php code: put inside the data to be displayed second file index.php code: pop-up text < html > < head > < script src = "http://code.jquery.com/jquery-latest.js" ></ script > < script > $ ( document ). ready ( function () { $ ( "#responsecontainer" ). load ( "response.php" ); var refreshId = setInterval ( function () { $ ( "#responsecontainer" ). load ( 'response.php?randval=' + Math . random ()); } , 1000 ); $ . ajaxSetup ( { cache : false } ); } ); </ script > </ head > < body > < iframe src = "main.php" width = "100%" height = "25%"