PHP Code

Thumbnail image creation using php code

In this post explains how to create thumbnail image using php code. function make_thumb($img_name,$filename,$new_w,$new_h) { //get image extension. $ext=getExtension($img_name); //creates the new image using the appropriate function from gd library if(!strcmp(“jpg”,$ext) || !strcmp(“JPG”,$ext) || !strcmp(“jpeg”,$ext) || !strcmp(“JPEG”,$ext)) $src_img=imagecreatefromjpeg($img_name); if(!strcmp(“gif”,$ext) || !strcmp(“GIF”,$ext)) $src_img=imagecreatefromgif($img_name); if(!strcmp(“png”,$ext) || !strcmp(“PNG”,$ext)) $src_img=imagecreatefrompng($img_name); //gets the dimmensions of the image $old_x=imagesx($src_img); $old_y=imagesy($src_img); $ratio1=$old_x/$new_w; …

Continue Reading
PHP Code

How to get complete information about server using PHP code

Hi, In php there is one predefined variable called $_SERVER, with that only we can get the complete information about server. We can get all server information with the below code. And easily access the information for your coding part. Once check the below script: <?php echo "<table border = ‘2’ style=’color:#ffffff;’>"; $i = 0; …

Continue Reading