Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default PHP - GD Failure.

    Well, I made a script that takes abunch of variables and turns them into an image, basically. The result should be like "#their_name# is #system_chosen_var# in their free time."
    But it says "cannot be displayed due to errors".

    Here's the page source.
    http://habaround.co.uk/index_source

    Page.
    http://habaround.co.uk/index.php

    Help please?
    Last edited by lolwut; 28-09-2007 at 09:12 PM.
    i've been here for over 8 years and i don't know why

  2. #2
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    remove:

    echo $im;


    move:
    header("Content-type: image/png");

    right above imagepng

    then tell me the error

  3. #3
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Erm.
    Didn't exacly get that.
    But I removed the echo line and the header(""); got removed too.
    New source: http://habaround.co.uk/index_source
    Link: http://habaround.co.uk/?name=Anything
    i've been here for over 8 years and i don't know why

  4. #4
    ScottDiamond. Guest

    Default

    PHP Code:
    <?php
    $name 
    $_GET['name'];
    $p1 "Abraham Lincoln";
    $p2 "Martin Luther King";
    $p3 "Clark Kent";
    $p4 "Spider Pig";
    $p5 "Eddie Murphy";
    $p6 "Avril Lagvine";
    $p7 "Steven Gerrard";
    $p8 "Jamie T";
    $p9 "Dave Grohl";
    $p10 "Davina McCall";
    $rand rand(1,10);

    if(
    $rand == "1"){
    $output $p1;
    }
    if(
    $rand == "2"){
    $output $p2;
    }
    if(
    $rand == "3"){
    $output $p3;
    }
    if(
    $rand == "4"){
    $output $p4;
    }
    if(
    $rand == "5"){
    $output $p5;
    }
    if(
    $rand == "6"){
    $output $p6;
    }
    if(
    $rand == "7"){
    $output $p7;
    }
    if(
    $rand == "8"){
    $output $p8;
    }
    if(
    $rand == "9"){
    $output $p9;
    }
    if(
    $rand == "10"){
    $output $p10;
    }


    $op $name " is " $output " in their free time.";

    $string $op;
    header("Content-type: image/png");
    $im imagecreatefrompng("bg.png");
    $orange imagecolorallocate($im22021060);
    $px = (imagesx($im) - 7.5 strlen($string)) / 2;
    imagestring($im3$px9$string$orange);
    imagepng($im);
    imagedestroy($im);


    ?>

  5. #5
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Changed source to ScottDiamond.'s one.

    Says "The image “http://habaround.co.uk/?name=Hello” cannot be displayed, because it contains errors."

    And in my error_log it says "[29-Sep-2007 05:00:22] PHP Fatal error: Call to undefined function: imagecreatefrompng() in /home/habaroun/public_html/index.php on line 51".
    i've been here for over 8 years and i don't know why

  6. #6
    ScottDiamond. Guest

    Default

    Does bg.png exsist?

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    You have not got GD installed, its outdated or its not working properly. Give us a link to a phpinfo page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •