PHP Security Attacks and Prevention

XSS Attack- Cross site scripting https://www.sitepoint.com/php-security-cross-site-scripting-attacks-xss/ CSRF ATTACK Example: <?php if(isset($_POST[“pp”])){ echo $_POST[“pp”]; } ?> <form action=”” method=”post”> <textarea name=”pp”></textarea> <input type=”submit”> </form> //now paste within comment box: <body onLoad=”document.forms[0].submit()”> <form action=”https://pnbnetbanking.org.in/”> <input type=”accountnum” value=”126172612″> <input type=”amount” value=”100″> <input type=”submit”>…

Merge Sort

<?php $arr = array( 6,1,3,7,5,2,3,4,45,5,4,75,8,6,78,7980890,2,4,2,432,5,34,5634,34,5); echo “<br>”.implode(‘,’,$arr).”<br>”; $arr=mergesort($arr); echo implode(‘,’,$arr); function mergesort($numlist) { if(count($numlist) == 1 ) return $numlist; $mid = count($numlist) / 2; $left = array_slice($numlist, 0, $mid); $right = array_slice($numlist, $mid); $left = mergesort($left); $right = mergesort($right); return…

Google Map Autocomplete Address

Here is the complete code to add google map autocomplete search box. Generate Google key from the following URL : https://developers.google.com/maps/documentation/javascript/get-api-key Note:Replace googlekey in the below code with your genrated one <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html…

Idle User Logout

Hi this post is for implementing idle user logout. I have written it using wordpress db object. Because wordpress is based on cookies and default expiry time is 2 weeks. But wordpress does not provide any intuit functionality for logging…

Page 3 of 712345...Last »