#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    20
    Rep Power
    0
    can any body help me how can i build a php file which can be called with <img src= > tag . this PHP file may or may not produce any picture....
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    15
    You can just enter the URL to the php file but the return value can not be shown in the browser, not even when it is a picture. So you need to make the picture a 1X1 pixel-picture so it does not show.

    If you want a new picture that you can't hardcode in advance to appear you have to use a frame.

    ------------------
    Ramon Litjens
    Boradoli Web Design
    (www.boradoli.nl)
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,640
    Rep Power
    4476
    I would think it would have to return an image, otherwise you'll get that broken link picture. if you make it 1x1 pixels, that would kind of hide it. I'm curious why you would want to call a php file from the src tag of an img? can you share anymore info?

    to call the file, use
    <img src="button.php3?text">

    From the php manual of what button.php3 could look like:

    1
    2 <?php
    3 Header("Content-type: image/gif");
    4 $string=implode($argv," ");
    5 $im = imagecreatefromgif("images/button1.gif");
    6 $orange = ImageColorAllocate($im, 220, 210, 60);
    7 $px = (imagesx($im)-7.5*strlen($string))/2;
    8 ImageString ($im,3,$px,9,$string,$orange);
    9 ImageGif($im);
    10 ImageDestroy($im);
    11 ?>
    12

    ---John Holmes
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    I would think it would have to return an image, otherwise you'll get that broken link picture.

    yea,It should return an image...

    ------------------
    SR -
    shiju.dreamcenter.net

    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. Replies: 3
    Last Post: February 17th, 2004, 10:08 AM
  2. How to write a PHP script to remove a file?
    By xmxpcom in forum PHP Development
    Replies: 2
    Last Post: February 16th, 2004, 05:58 PM
  3. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM
  4. Replies: 1
    Last Post: February 5th, 2004, 09:38 AM
  5. Simple find and replace word search for a text file with php?
    By rabid lemming in forum PHP Development
    Replies: 4
    Last Post: February 1st, 2004, 09:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo