I am new to php, PLESAE HELP!

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default I am new to php, PLESAE HELP!

    Hello to everyone
    I was trying to do the following in one of the php pages:
    <img src="image.php?image=s01.jpg">

    What should I put in "image.php" file?
    I currently have:
    <?php
    $imageurl=$_GET["image"];
    echo $imageurl;
    ?>

    If I just do "http://localhost/php/image.php?image=s01.jpg"
    It works just fine (i mean it shows the filename I provide through "image")
    I am running IIS on Windows XP Pro

    Thanks.


    Nurchi BECHED Guest

  2. #2

    Default Re: I am new to php, PLESAE HELP!

    maybe...this might help:

    <?php
    $imageurl=$_GET["image"];
    echo "<img src=\"$imageurl\">";
    ?>

    an alternate version would be
    <?
    $imageurl=$_GET["image"];
    ?>
    <img src="<? echo $imageurl ?>";


    hope this helps
    G


    "Nurchi BECHED" <nurchi@telus.net> wrote in message
    news:2XHfc.29481$dg7.11745@edtnps84...
    > Hello to everyone
    > I was trying to do the following in one of the php pages:
    > <img src="image.php?image=s01.jpg">
    >
    > What should I put in "image.php" file?
    > I currently have:
    > <?php
    > $imageurl=$_GET["image"];
    > echo $imageurl;
    > ?>
    >
    > If I just do "http://localhost/php/image.php?image=s01.jpg"
    > It works just fine (i mean it shows the filename I provide through
    "image")
    > I am running IIS on Windows XP Pro
    >
    > Thanks.
    >
    >

    Gary Tsui Guest

  3. #3

    Default Re: I am new to php, PLESAE HELP!

    "Nurchi BECHED" <nurchi@telus.net> wrote in message
    news:2XHfc.29481$dg7.11745@edtnps84...
    > Hello to everyone
    > I was trying to do the following in one of the php pages:
    > <img src="image.php?image=s01.jpg">
    >
    > What should I put in "image.php" file?
    > I currently have:
    > <?php
    > $imageurl=$_GET["image"];
    > echo $imageurl;
    > ?>
    >
    > If I just do "http://localhost/php/image.php?image=s01.jpg"
    > It works just fine (i mean it shows the filename I provide through
    "image")

    What exactly are you trying to do? You're not very clear in the question.
    Are you trying to display the image?
    if so, try:

    <?
    header('Content-type: image/jpeg);
    include($_GET['image']);
    ?>


    Kevin Torr Guest

  4. #4

    Default Re: I am new to php, PLESAE HELP!

    Hello, Kevin!
    You wrote on Fri, 16 Apr 2004 22:14:48 +1000:

    KT> What exactly are you trying to do? You're not very clear in the
    KT> question.
    KT> Are you trying to display the image?
    KT> if so, try:
    ....
    KT> <?
    KT> header('Content-type: image/jpeg);
    KT> include($_GET['image']);
    KT> ?>

    Thanks, this helped, except for I had to use 'readfile' instead of
    'include'.
    Now it works.
    Thanks again.

    With best regards, Nurchi BECHED.

    P.S.
    C makes it easy to shoot yourself in the foot;
    C++ makes it harder, but when you do,
    it blows away your whole leg."
    --Bjarne Stroustrup


    Nurchi BECHED Guest

  5. #5

    Default Re: I am new to php, PLESAE HELP!


    <?php
    $dir = './images/'; //path to images
    location( $dir.$_GET['image'] );
    ?>

    Nurchi BECHED wrote:
    > Hello to everyone
    > I was trying to do the following in one of the php pages:
    > <img src="image.php?image=s01.jpg">
    >
    > What should I put in "image.php" file?
    > I currently have:
    > <?php
    > $imageurl=$_GET["image"];
    > echo $imageurl;
    > ?>
    >
    > If I just do "http://localhost/php/image.php?image=s01.jpg"
    > It works just fine (i mean it shows the filename I provide through "image")
    > I am running IIS on Windows XP Pro
    >
    > Thanks.
    >
    >
    Smifffy Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139