Tag: web

  • Size conversion filter using AngularJS

    Following code should give you a clean and simple example of custom filter using AngularJS. HTML code: ——————— <!doctype html> <html > <head> <script src=”src=”http://code.angularjs.org/angular-1.0.0rc6.min.js”></script > <script src=”filter.js“></script> </head> <body> <div ng-app=”testFilterApp“> <label>Size in Byte:</label> <input type=”text” ng-model=”sizeInB” placeholder=”Enter a name here”> <hr> <h2>Human Readable Size (precision:3) {{sizeInB | sizeConverter:3}}!</h2> <h2>Human Readable Size (precision: not…

  • jQuery Ajax Tooltip

    This is very much based on the Coda Popup Bubble example for jQuery that’s been going around with a few important differences: The information is requested via AJAX, so you don’t have to include all of this extra information in a hidden div. This keeps your markup smaller for grids with tons of names in…

  • Php page redirection problem

    So far i did web development I used javascript redirection. But recently i needed to do that with php. But i got stacked with some annoying problems. 1. Headers are already sent. 2. SESSION variables are not setting. 1. Ok, now here javascript again rescue me see how. function redirect($url) { if(!headers_sent()) { //If headers…

  • A nice script to upload a image and re-sizing them

    MAX_SIZE*1024){ echo “You have exceeded the size limit”; $errors=1; } if($extension==”jpg” || $extension==”jpeg” ){ $uploadedfile = $_FILES[‘file’][‘tmp_name’]; $src = imagecreatefromjpeg($uploadedfile); } else if($extension==”png”){ $uploadedfile = $_FILES[‘file’][‘tmp_name’]; $src = imagecreatefrompng($uploadedfile); } else { $src = imagecreatefromgif($uploadedfile); } list($width,$height)=getimagesize($uploadedfile); $newwidth=60; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); $newwidth1=25; $newheight1=($height/$width)*$newwidth1; $tmp1=imagecreatetruecolor($newwidth1,$newheight1); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height); $filename = “images/small/”. $_FILES[‘file’][‘name’]; $filename1 = “images/small/”. $_FILES[‘file’][‘name’]; imagejpeg($tmp,$filename,100); imagejpeg($tmp1,$filename1,100);…