Tag Archives: php

Redirect one domain to another domain in htaccess file

Hi, RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !unlimited.ndot.in$ [NC] RewriteRule ^(.*)$ http://unlimited.ndot.in/$1 [L,R=301] Here unlimited.ndot.in is my destination domain name.

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , | Leave a comment

mysql date_format() list

DATE_FORMAT() function formats the date by specifying a sequence of format strings. A string is composed of the percentage symbol ‘%’ followed by a formatting letter. These are some of the more common strings to use: Specifier Description %a Abbreviated … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , , | Leave a comment

check/uncheck the multiple checkboxes in php

<span>Select : </span> <a href=”javascript:request_all();” title=”All”>All</a> &nbsp; <a href=”javascript:request_none();” title=”None”>None</a> </p> //pending request all function request_all() { if(document.pending_request.pending_req_list.length==undefined) { document.pending_request.pending_req_list.checked=true; } for(var i=0; i < document.pending_request.pending_req_list.length; i++) { if(!document.pending_request.pending_req_list[i].checked) { document.pending_request.pending_req_list[i].checked=true; } } } //pending request none function request_none() { … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , | 2 Comments

Php random text generating for forgot password and etc..,

//generate random code function createRandomPassword() { $chars = “abcdefghijkmnopqrstuvwxyz023456789″; srand((double)microtime()*1000000); $i = 0; $pass = ” ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , , | Leave a comment

Lost connection to MySQL server at ‘reading initial communication packet’, system error: 113

Hi to all, While connecting DB in php, I am getting error called “Lost connection to MySQL server at ‘reading initial communication packet’, system error: 113″. What is the reason to get this error. Anybody to know about it. thanks … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , , | Leave a comment

mysql_error() function in php

Use of mysql_error() in php <?php $link = mysql_connect(“localhost”, ”mysql_user”, ”mysql_password”); mysql_select_db(“nonexistentdb”, $link); echo mysql_errno($link) . ”: ” . mysql_error($link). ”\n”; mysql_select_db(“kossu”, $link); mysql_query(“SELECT * FROM nonexistenttable”, $link); echo mysql_errno($link) . ”: ” . mysql_error($link) . ”\n”; ?>

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , | Leave a comment

Best php image uploading script

$result    = mysql_query ($query,$dbc); $lastId  = $dealer_id; //upload the logo file if(is_uploaded_file ($_FILES['logo']['tmp_name'])) { move_uploaded_file($_FILES['logo']['tmp_name'],$IMG_PATH.”/uptemp/”.$lastId.”_”.$image); } //normal size image $widthadjust  = 300; $heightadjust  = 160; $add = “uptemp/”.$lastId.”_”.$image; $ext = explode(‘.’,$lastId.”_”.$image); if($ext[1] == “jpg” || $ext[1] == “jpeg”) { $im … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Programming | Tagged , , , , , | Leave a comment

Learning social media APIs with PHP, MySQL & Javascripts

All social media sites including facebook, twiiter, linkedin, buzz & wordpress are providing APIs using XML, REST & Javascript (JASON) based APIs. They are providing developer portal for developers to communicate with other developers to discuss, colloborate & share. There … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in Uncategorized | Tagged , , , , , , , , | 1 Comment

PHP Image resizing with same quality

We have written a script that will resize all PNG images on same folder with almost same quality. It reduces file sizes to almost 12 times less than Original file. /** * NDOT.in * Created on April 9th 2010 **/ … Continue reading

  • October 14, 2012 |
  • 0 Comments
Posted in outsourcing, Programming | Tagged , , , | Leave a comment