Stop PHP errors by using .htaccess file

Just paste the given below file in a .htaccess file and put it in a web directory(generally root) and see the magic, dont forget to provide a log file at the end if you want to store all errors. php_value error_reporting 2047 php_flag display_errors false php_flag display_startup_errors false php_flag log_errors true php_value log_errors_max_len 100M php_flag [...]

Full Story »

Block Hot linking

Hey Guys, If you want to prevent users from directly linking to images on your site that is called hot linking then you can use this code in .htaccess file to prevent this action. RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?site.com/.*$ [NC] RewriteRule \.(gif|jpg|png)$ – [F] it will deny the access to that image, [...]

Full Story »

Select and unselect all checkbox using one master checkbox

<form method=”post” action=”something.php”> <input type=”checkbox” name=”mainbox”  id=”mainbox” value=”” onclick=”checkstatus()”> <input type=”checkbox” name=”anyname1″  id=”anyname1″ value=”1″ > <input type=”checkbox” name=”anyname2″  id=”anyname1″ value=”2″ > <input type=”checkbox” name=”anyname3″  id=”anyname1″ value=”3″ > <input type=”checkbox” name=”anyname4″  id=”anyname1″ value=”4″ > <from> #################################################################### <script> function checkstatus() { if(document.getElementById(“mainbox”).checked==true) { alert(“checked”); checkbox = document.getElementsByTagName(‘input’); for (i = 0; i < checkbox.length; i++) { checkbox[i].checked [...]

Full Story »

PHP 5 Paging Class

I have written a class  and a example below the class to help you to use. <?php class paging { public $mysqli=NULL; public $result=NULL; public $totalrows=NULL; public $currentpage=1; public $limit=4; function __construct() { $this->mysqli= new mysqli (‘localhost’,’root’,”,’test’); } public function myresullt ($query) { $this->totalrows=$this->mysqli->query($query)->num_rows; $new_query=$query.’ limit ‘. (($this->currentpage*$this->limit)-$this->limit).’,’.$this->limit; $this->result=$this->mysqli->query($new_query); } public function myfetch () { [...]

Full Story »

Search around a particular Latitude and longitude by a given radius

This post is related to search around a particular latitude and longitude for a given radius in Km or Miles. One degree of latitude is equal to about 69 or 70 miles or 111 Km. Suppose you have to search in a circle of 4 miles ,the center of the the circle is lat,long you [...]

Full Story »
Page 3 of 5«12345»