Help Me

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help Me

    my english bad

    new server is problem preview.php help me

    <?
    if(!isset($neww) || $neww==&#39;&#39;)$neww=40;
    if(!isset($newh) || $newh==&#39;&#39;)$newh=40;
    list(, , $type,)=getimagesize($file);
    if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}
    if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}
    $im1 = $funci($file);
    $im2=imagecreatetruecolor($neww,$newh);
    imagecopyresized($im2, $im1, 0,0,0,0,$neww,$newh, imagesx($im1), imagesy($im1));
    header("Content-type: image/png");
    imagepng($im2);
    ?>

    error code Fatal error: Call to undefined function: () in /home/myweb/public_html/preview.php on line 7


    #2
    hello new php code write no problem thanks.

    Comment


      #3

      place this like image.php

      then image.php?image=url&amp;w=100&amp;h=100;

      Code:
      <?php
      
      
      if($_GET[&#39;image&#39;]){ 
          $image = $_GET[&#39;image&#39;]; 
      
          if($_GET[&#39;type&#39;]=="jpg"){ 
              header("Content-type: image/jpeg"); 
          }elseif($_GET[&#39;type&#39;]=="gif"){ 
              header("Content-type: image/gif"); 
          }elseif($_GET[&#39;type&#39;]=="png"){ 
              header("Content-type: image/png"); 
          }else{ 
              if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){header("Content-type: image/jpeg");} 
              elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){header("Content-type: image/gif");} 
              elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){header("Content-type: image/png");} 
          } 
           
          if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){$im = imagecreatefromjpeg($image);} 
          elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){$im = imagecreatefromgif($image);} 
          elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){$im = imagecreatefrompng($image);} 
           
          if($_GET[&#39;percent&#39;]){ 
              $x = round((imagesx($im)*$_GET[&#39;percent&#39;])/100); 
              $y = round((imagesy($im)*$_GET[&#39;percent&#39;])/100); 
              $yyy=0; 
              $xxx=0; 
              $imw = imagecreatetruecolor($x,$y); 
          }elseif($_GET[&#39;w&#39;] and $_GET[&#39;h&#39;]){ 
              $x = $_GET[&#39;w&#39;]; 
              $y = $_GET[&#39;h&#39;]; 
              $yyy=0; 
              $xxx=0; 
              $imw = imagecreatetruecolor($x,$y); 
          }elseif($_GET[&#39;maxim_size&#39;]){ 
              if(imagesy($im)>=$_GET[&#39;maxim_size&#39;] || imagesx($im)>=$_GET[&#39;maxim_size&#39;]){ 
                  if(imagesy($im)>=imagesx($im)){ 
                      $y = $_GET[&#39;maxim_size&#39;]; 
                      $x = ($y*imagesx($im))/imagesy($im); 
                  }else{ 
                      $x = $_GET[&#39;maxim_size&#39;]; 
                      $y = ($x*imagesy($im))/imagesx($im); 
                  } 
              }else{ 
                  $x = imagesx($im); 
                  $y = imagesy($im); 
              } 
              $yyy=0; 
              $xxx=0; 
              $imw = imagecreatetruecolor($x,$y); 
          }elseif($_GET[&#39;square&#39;]){ 
              if(imagesy($im)>=$_GET[&#39;square&#39;] || imagesx($im)>=$_GET[&#39;square&#39;]){ 
                  if(imagesy($im)>=imagesx($im)){ 
                      $x = $_GET[&#39;square&#39;]; 
                      $y = ($x*imagesy($im))/imagesx($im); 
                      $yyy=-($y-$x)/2; 
                      $xxx=0; 
                  }else{ 
                      $y = $_GET[&#39;square&#39;]; 
                      $x = ($y*imagesx($im))/imagesy($im); 
                      $xxx=-($x-$y)/2; 
                      $yyy=0; 
                  } 
              }else{ 
                  $x = imagesx($im); 
                  $y = imagesy($im); 
                  $yyy=0; 
                  $xxx=0; 
              } 
              $imw = imagecreatetruecolor($_GET[&#39;square&#39;],$_GET[&#39;square&#39;]); 
          }else{ 
              $x = imagesx($im); 
              $y = imagesy($im); 
              $yyy=0; 
              $xxx=0; 
              $imw = imagecreatetruecolor($x,$y); 
          } 
           
          imagecopyresampled($imw, $im, $xxx,$yyy,0,0,$x,$y,imagesx($im), imagesy($im)); 
           
          if($_GET[&#39;watermark_text&#39;]){ 
              if($_GET[&#39;watermark_color&#39;]){$watermark_color=E0E0E0; 
              }else{ 
                  $watermark_color="E0E0E0";
              } 
              $red=hexdec(substr($watermark_color,0,2)); 
              $green=hexdec(substr($watermark_color,2,2)); 
              $blue=hexdec(substr($watermark_color,4,2)); 
               
              $text_col = imagecolorallocate($imw, $red,$green,$blue); 
              $font = "georgia.ttf"; //this font(georgia.ttf) heave to be in the same directory as this script 
              $font_size = 12; 
              $angle = 0; 
              $box = imagettfbbox($font_size, $angle, $font, GR.WS); 
              $x = 5; 
              $y = 17; 
              imagettftext($imw, $font_size, $angle, $x, $y, $text_col, $font, GR.WS); 
      
          } 
           
          if($_GET[&#39;type&#39;]=="jpg"){imagejpeg($imw);} 
          elseif($_GET[&#39;type&#39;]=="gif"){imagegif($imw);} 
          elseif($_GET[&#39;type&#39;]=="png"){imagepng($imw);} 
          else{ 
              if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){imagejpeg($imw);} 
              elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){imagegif($imw);} 
              elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){imagepng($imw);} 
          } 
           
          imagedestroy($imw); 
      } 
      ?>
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        thanks subzero

        Comment


          #5
          server problem is server_global Off change On problem finish

          Comment


            #6
            topic closed then lol
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment

            Working...
            X