Wednesday, October 2, 2013

resize any image using php

$im_link='your img path';

$filename=str_replace(" ", "%20",$im_link);
$max_width=630; /* set your div frame width */
$max_height=1000; /* set your div frame height*/

$data = getimagesize($filename);
$_orig_width = $data[0];
$_orig_height = $data[1];

if($_orig_width>$max_width)
{
$new_big_img_width_per=($max_width*100)/$_orig_width;
$new_big_img_height=($_orig_height*$new_big_img_width_per)/100;

$final_height=round($new_big_img_height,0);
$final_width=$max_width;
}
else
{
$final_height=$final_width='auto';
}


echo '<img src="'.$im_link.'" height="'.$final_height.'" width="'.$final_width'" />


.........................................enjoy................................................

Sunday, September 15, 2013

hide any popup or required object when click outside of the object

/* just replace the #selector and enjoy */
var mouse_is_inside = false;

$(document).ready(function()
{
    $('#profile_links').hover(function(){
        mouse_is_inside=true;
    }, function(){
        mouse_is_inside=false;
    });

    $("body").mouseup(function(){
        if(! mouse_is_inside) $('#profile_links').hide();

/* if(! mouse_is_inside)
 {
 $('#login_box').hide();
  $('#master_loader').hide();
 }
 */
    });

$('#login_box').hover(function(){
        mouse_is_inside=true;
    }, function(){
        mouse_is_inside=false;
    });

    $("body").mouseup(function(){
        //if(! mouse_is_inside) $('#login_box').hide();
if(! mouse_is_inside)
 {
 $('#login_box').hide();
  $('#master_loader').hide();
 }

    });
});

Saturday, August 17, 2013

Download PDF books

This folder have containing following pdfs.
1. [SitePoint] Simply JavaScript
2. ASP NET - Web Developers Guide
3. Beginning_MYSQL_5_with_Visual_Studio.NET_2005
4. Java Swing, 2nd Edition
5. jQuery.in.Action.Feb.2008.Manning (2)
6. Operating System Concepts
7. Oracle 9i
8. PHP A BEGINNERS GUIDE
9. SCJP Sun Certified Programmer for Java 6

Download Link #1-: https://drive.google.com/folderview?id=0BweG5sKiHRrxa0gtT2wwYzdBV0k&usp=sharing


Download shopping cart template

Regular Expression Syntax in PHP


Regular Expression Syntax

^ – Start of string
$ – End of string
. – Any single character
( ) – Group of expressions
[] – Item range ( e.g. [afg] means a, f, or g )
[^] – Items not in range ( e.g. [^cde] means not c, d, or e )
- (dash) – character range within an item range ( e.g. [a-z] means a through z )
| (pipe) – Logical or ( e.g. (a|b) means a or b )
? – Zero or one of preceding character/item range
* – Zero or more of preceding character/item range
+ – One or more of preceding character/item range
{integer} – Exactly integer of preceding character/item range ( e.g. a{2} )
{integer,} – Integer or more of preceding character/item range ( e.g. a{2,} )
{integer,integer} – From integer to integer (e.g. a{2,4} means 2 to four of a )
\ – Escape character
[:punct:] – Any punctuation
[:space:] – Any space character
[:blank:] – Any space or tab
[:digit:] – Any digit: 0 through 9
[:alpha:] – All letters: a-z and A-Z
[:alnum:] – All digits and letters: 0-9, a-z, and A-Z
[:xdigit:] – Hexadecimal digit
[:print:] – Any printable character
[:upper:] – All uppercase letters: A-Z
[:lower:] – All lowercase letters: a-z