Showing different image source than real !!!

Discussion in 'PHP' started by prabhakar, Feb 25, 2009.

  1. #1
    Is it possible?

    When inserting an image with html, we use src tags, which directly link to images. But I want to that source to be something like this in image tag,

    which should have a source like this,

    Please note, here names of both images are not same. [ 12345.jpg is real, foot-ball.jpg is fake, which I have to show as image source.]

    I think it can be done through header(); in image.php. But I need to show about 43,000 images like this, with different sources,like this,

    usd.jpg corresponding to 123456.jpg;
    euro.jpg corresponding to 35689.jpg;
    ..... and so on.

    Actually, I get these images from a datafeed, which I parse into mysql. It contains these data:

    title, image source, discription.

    Now, I want to show image source as title, which gets image from image source.

    Is there any way? Applicable for 43,000 images....

    Problem is that I at in very basic stage of php.
     
    prabhakar, Feb 25, 2009 IP
  2. imchandan

    imchandan Guest

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    your html file has
    <img src="/image.php?image=foot-ball.jpg"

    -----------------
    image.php may contain
    <?php
    //connect to database
    fetch real file name
    then echo $file_name;


    That's it
    Please correct me if i am wrong
     
    imchandan, Feb 25, 2009 IP
  3. jordan shoes

    jordan shoes Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    pls change src="/image.php?image=foot-ball.jpg" to src="image.php?image=foot-ball.jpg" try again
     
    jordan shoes, Feb 25, 2009 IP