Click here to Skip to main content
15,886,816 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: option 'explicit' for php Pin
fly90424-Sep-09 13:51
fly90424-Sep-09 13:51 
GeneralRe: option 'explicit' for php Pin
Marc Firth24-Sep-09 22:55
Marc Firth24-Sep-09 22:55 
AnswerRe: option 'explicit' for php Pin
Vasudevan Deepak Kumar25-Sep-09 2:09
Vasudevan Deepak Kumar25-Sep-09 2:09 
QuestionDownload a file from a link? [modified] Pin
huh123422-Sep-09 19:38
huh123422-Sep-09 19:38 
AnswerRe: Download a file from a link? Pin
enhzflep22-Sep-09 23:05
enhzflep22-Sep-09 23:05 
GeneralRe: Download a file from a link? Pin
huh123423-Sep-09 18:41
huh123423-Sep-09 18:41 
AnswerRe: Download a file from a link? Pin
fly90423-Sep-09 1:46
fly90423-Sep-09 1:46 
AnswerRe: Download a file from a link? Pin
Marc Firth23-Sep-09 1:54
Marc Firth23-Sep-09 1:54 
Thumbnail function:

<?php

function create_thumbnail($image_path, $thumbnail_width, $thumbnail_height, $thumbnail_path="")
{
     $imgSize = getimagesize($image_path);
     $imgExtension = "";

      switch ($imgSize[2])
      {
           case 1:
                $imgExtension = '.gif';
                  break;

           case 2:
                $imgExtension = '.jpg';
                break;

           case 3:
                $imgExtension = '.png';
                break;
      }
    
     if ($thumbnail_path=="") $thumbnail_path = (basename($image_path, $imgExtension))."_thumb".$imgExtension ;

     // Get new dimensions
     list($width, $height) = getimagesize($image_path);

     // Resample
     $resampledImage = imagecreatetruecolor($thumbnail_width, $thumbnail_height);

     if ( $imgExtension == ".jpg" )
     {
          $image = imagecreatefromjpeg($image_path);
     }
     else if ( $imgExtension == ".gif" )
     {
          $image = imagecreatefromgif($image_path);
     }
     else if ( $imgExtension == ".png" )
     {
          $image = imagecreatefrompng($image_path);
     }

     imagecopyresampled($resampledImage, $image, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $width, $height);

     if ( $imgExtension == ".jpg" )
     {
          imagejpeg($resampledImage, $thumbnail_path);
     }
     else if ( $imgExtension == ".gif" )
     {
          imagegif($resampledImage, $thumbnail_path);
     }
     else if ( $imgExtension == ".png" )
     {
          imagepng($resampledImage, $thumbnail_path);
     }
    
}

?>


AnswerRe: Download a file from a link? Pin
huh123423-Sep-09 17:39
huh123423-Sep-09 17:39 
QuestionWeb pages do not display Pin
Steve Holdorf20-Sep-09 5:47
Steve Holdorf20-Sep-09 5:47 
AnswerRe: Web pages do not display Pin
Steve Holdorf20-Sep-09 7:40
Steve Holdorf20-Sep-09 7:40 
GeneralRe: Web pages do not display Pin
Marc Firth28-Sep-09 5:58
Marc Firth28-Sep-09 5:58 
QuestionAnti Frame Breaker Code Pin
stambekar18-Sep-09 1:31
stambekar18-Sep-09 1:31 
AnswerRe: Anti Frame Breaker Code Pin
enhzflep18-Sep-09 5:35
enhzflep18-Sep-09 5:35 
GeneralRe: Anti Frame Breaker Code Pin
stambekar20-Sep-09 19:15
stambekar20-Sep-09 19:15 
GeneralRe: Anti Frame Breaker Code [modified] Pin
enhzflep22-Sep-09 18:24
enhzflep22-Sep-09 18:24 
QuestionPython Debugger? [modified] Pin
Joe Woodbury16-Sep-09 11:22
professionalJoe Woodbury16-Sep-09 11:22 
AnswerRe: Python Debugger? Pin
Med7at24-Sep-09 18:51
Med7at24-Sep-09 18:51 
GeneralRe: Python Debugger? Pin
anand mohan12329-Sep-09 14:30
anand mohan12329-Sep-09 14:30 
Questionupload photo Pin
pallavi shrivastava16-Sep-09 3:28
pallavi shrivastava16-Sep-09 3:28 
AnswerRe: upload photo Pin
EliottA16-Sep-09 6:10
EliottA16-Sep-09 6:10 
AnswerRe: upload photo Pin
Marc Firth17-Sep-09 14:37
Marc Firth17-Sep-09 14:37 
Questionsend email Pin
pallavi shrivastava15-Sep-09 2:59
pallavi shrivastava15-Sep-09 2:59 
AnswerRe: send email Pin
fly90415-Sep-09 7:42
fly90415-Sep-09 7:42 
QuestionGridview Pin
jaraldumary15-Sep-09 0:51
jaraldumary15-Sep-09 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.