Showing images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ChristofLaeremans
Forum Newbie
Posts: 2
Joined: Fri May 06, 2005 1:25 am
Location: Tienen, Belgium

Showing images

Post by ChristofLaeremans »

Hello,

I'm creating a new website for showing my photo's on a webpage. The first code for getting the photo's (jpg files) out off a directory and show it on a webpage works (on the provider I don't have a MySQL database, so I need to work with directories).

I also created a link to the image for showing it in a new page. But now I want to use another page with some text, border etc ... for showing the image.
After searching on the net I found that you can do it with passing arguments like. "weergeven.php?ARG=fungi.jpg" and then write in the weergeven.php "echo $ARG".
But it doesn't work, there is no value in the variable $ARG.

Can someone help me with this problem or is there a more elegant solution ?

Thanks,

Christof Laeremans
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Try
echo $_GET['ARG'];
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

Code: Select all

if (isset($_GET['ARG']))
{
  print "<img src=\"{$_GET['ARG']}\">";
}
else
{
  print "argument not passed";
}
ChristofLaeremans
Forum Newbie
Posts: 2
Joined: Fri May 06, 2005 1:25 am
Location: Tienen, Belgium

Post by ChristofLaeremans »

Thank you, it works now !

Christof Laeremans
Post Reply