Need A PHP expert: Simple and fast change (my allow_url_fopen is disabled)

Discussion in 'Programming' started by bertamus11, Apr 12, 2008.

  1. #1
    Hi there, and thank you for helping if you can.

    Here's what I have to show my image:
    <?php

    header('content-type: image/jpeg');

    $watermark = imagecreatefrompng('watermark.png');
    $watermark_width = imagesx($watermark);
    $watermark_height = imagesy($watermark);
    $image = imagecreatetruecolor($watermark_width, $watermark_height);
    $image = imagecreatefromjpeg($_GET['src']);
    $size = getimagesize($_GET['src']);
    $dest_x = $size[0] - $watermark_width - 5;
    $dest_y = $size[1] - $watermark_height - 5;
    imagecopy($image, $watermark, $dest_x , $dest_y, 0, 0, $watermark_width, $watermark_height);
    imagejpeg($image);
    imagedestroy($image);
    imagedestroy($watermark);

    ?>

    Problem is I'm at dreamhost and they have "allow_url_fopen" disabled so I'm getting errors from the $_GET I think....

    I need someone to help me make it work in a different way that the server allows.

    Do I make any sense here? :) Thank you!
     
    bertamus11, Apr 12, 2008 IP
  2. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Are the images local from the $_GET variable? If they aren't you are going to have to use cURL or something similar to get the images rather than just getting them through $_GET variable.
     
    jmhyer123, Apr 12, 2008 IP
  3. smut

    smut Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    I can do it, PM me if you're interested
     
    smut, Apr 12, 2008 IP
  4. bertamus11

    bertamus11 Well-Known Member

    Messages:
    791
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    130
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    K. Job done. Thank you! That was fast!
     
    bertamus11, Apr 12, 2008 IP
  5. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    yes its a fast and easy thing :) just enable allow_url_fopen in your php.ini file :d
     
    AdnanAhsan, Apr 12, 2008 IP