PHP-created images

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

    PHP-created images

    Hello all,
    I've been wondering - how do I make dynamic images in PHP (example - the
    PHP and Zend logos when you do phpinfo().)? I have seen it done on several
    websites and I want to do it.
    Also, is there a correct way to use PHP to retrieve images? The only
    way I've ever got this to work is using require(). Here is what I did
    (note: it only works with ASCII encoded images, otherwise PHP errors):

    <?php

    switch ($imgnum)
    {
    case "1":
    require ("/home/img/menubutton.gif" );
    break;
    case "2":
    require ("/home/img/userprfl_bt.gif ");
    break;
    case "3":
    require ("/home/img/srch.gif");
    break;

    //etc...

    case "":
    default:
    require ("/home/img/error.gif");
    break;
    }

    ?>

    If you know how to do this, please post.
    ~Eric

    My PGP public key: http://www.parabolagames.com/chem/pgppubkey.txt


  • Robin

    #2
    Re: PHP-created images


    "Eric Stein" <no@spam.com> wrote in message
    news:c6jtl9$1n1 c$1@news.wplus. net...[color=blue]
    > Hello all,
    > I've been wondering - how do I make dynamic images in PHP (example -[/color]
    the[color=blue]
    > PHP and Zend logos when you do phpinfo().)? I have seen it done on[/color]
    several[color=blue]
    > websites and I want to do it.
    > Also, is there a correct way to use PHP to retrieve images? The only
    > way I've ever got this to work is using require(). Here is what I did
    > (note: it only works with ASCII encoded images, otherwise PHP errors):
    >
    > <?php
    >
    > switch ($imgnum)
    > {
    > case "1":
    > require ("/home/img/menubutton.gif" );
    > break;
    > case "2":
    > require ("/home/img/userprfl_bt.gif ");
    > break;
    > case "3":
    > require ("/home/img/srch.gif");
    > break;
    >
    > //etc...
    >
    > case "":
    > default:
    > require ("/home/img/error.gif");
    > break;
    > }
    >
    > ?>
    >
    > If you know how to do this, please post.
    > ~Eric[/color]

    if you really must get technical, requiring the images is not
    loading/creating them dynamically even if the php is somewhat
    dynamic. -Robin




    Comment

    • Eric Stein

      #3
      Re: PHP-created images

      Robin,
      I am perfectly aware of that. But I also know that you can create them
      dynamically - I did find the info I was looking for at
      http://us4.php.net/manual/en/ref.image.php. Mastering that looks like it's
      going to be difficult.
      ~Eric

      My PGP public key: http://www.parabolagames.com/chem/pgppubkey.txt

      "Robin" <robin @ infusedlight.ne t> wrote in message
      news:c6mabi$22o u$4@news.f.de.p lusline.net...[color=blue]
      > if you really must get technical, requiring the images is not
      > loading/creating them dynamically even if the php is somewhat
      > dynamic. -Robin[/color]


      Comment

      Working...