Results 1 to 8 of 8

Thread: PHP GD

  1. #1
    Join Date
    Jul 2004
    Location
    Ottawa, Canada
    Posts
    1,363
    Tokens
    1,513
    Habbo
    Yonder

    Latest Awards:

    Default PHP GD

    So im sure im missing something, i have done GD before and i have referred to my previous work but im just missing something im sure of it!

    PHP Code:
    <?PHP


    $default_style 
    '1';

    $style $_GET["style"];
    $style = ($style == '') ? $default_style $style;

    $file 'images/$style.png';
    $im imagecreatefrompng($file);



    $white imagecolorallocate ($im255255255);

    $font_file 'Volter.ttf';

    imagefttext($im200505130$white$font_file"HI");


    header('Content-Type: image/png');
    imagepng($im);
    imagedestroy($im);
    ?>
    Basically it works fine except i cannot choose a style it just sticks with the default one!

  2. #2
    Join Date
    Jan 2008
    Location
    Wales
    Posts
    3,594
    Tokens
    1,387
    Habbo
    Skizzling

    Latest Awards:

    Default

    Are you sure you've uploaded all the images?

    2.png etc.

  3. #3
    Join Date
    Jan 2008
    Location
    Wales
    Posts
    3,594
    Tokens
    1,387
    Habbo
    Skizzling

    Latest Awards:

    Default

    PHP Code:
    <?PHP

    $default_style 
    '1'

    $style $_GET["style"];
    $style = ($style == '') ? $default_style $style

    $file 'images/'.$style.'.png';
    $im imagecreatefrompng($file);



    $white imagecolorallocate ($im255255255);

    $font_file 'Volter.ttf';

    imagefttext($im200505130$white$font_file"HI");


    header('Content-Type: image/png');
    imagepng($im);
    imagedestroy($im);
    ?>
    That should work, I think?

    then countdown.php?style=1 but replace the 1 with whatever number style you want, you'll have to have 2.png etc. in the images folder.

    Sorry for double post btw.
    Last edited by Calvin; 30-11-2009 at 03:38 AM.

  4. #4
    Join Date
    Jul 2004
    Location
    Ottawa, Canada
    Posts
    1,363
    Tokens
    1,513
    Habbo
    Yonder

    Latest Awards:

    Default

    '.$style.' seems i missed huh?

    New it would be something simple i will try this out when i get home and yes i had all teh 2.png's etc

    Thanks alot rep+

    (have to spread)

  5. #5
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,580
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    I dont get how that works, can you explain ? im guessing its to do with your signiture thats on Habbox.com...
    Ross

  6. #6
    Join Date
    Jul 2004
    Location
    Ottawa, Canada
    Posts
    1,363
    Tokens
    1,513
    Habbo
    Yonder

    Latest Awards:

    Default

    Its part of a countdown script

  7. #7
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,580
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    Yeh i relise that but how does it workkkkkk ;[[[

  8. #8
    Join Date
    Jul 2004
    Location
    Ottawa, Canada
    Posts
    1,363
    Tokens
    1,513
    Habbo
    Yonder

    Latest Awards:

    Default

    Php script that spits out a png using GD.

Posting Permissions

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