loading images with php code
Posted: Thu Feb 17, 2011 4:19 am
Hello everyone!
I'm new to this forum and practically new to php.
What i'm going to ask probably has an obvious answer, but to me it is a riddle.
Thanks in advance to everyone:
I'm creating a personal photo portfolio of different events in different dates.
I have an event.php page, where i want different sets of images to be loaded, depending on the event name and date.
I have already managed to change the page's title with this code:
<?php
$EventName;
function event ()
{
global $EventName;
return htmlspecialchars($_GET["EventName"]);
}
echo event();
?>
so that when i add ?EventName=whatever
it returns "whatever" to my page title.
I would like now to load a set of images, all from the same directory -which would be already created and in its place-.
I want to "call" the directory with the same type of function.
Is there a way to link to "evento.php?EventName=whatever", so that it loads a directory called "whatever", where i have the images stored? And so that if i change the name it will change the directory where the images are coming from (they would be named 1.jpg, 2.jpg, etc.)
Thank you so much, i'm struggling to find the right code but i find myself in trouble.
Bye!
I'm new to this forum and practically new to php.
What i'm going to ask probably has an obvious answer, but to me it is a riddle.
Thanks in advance to everyone:
I'm creating a personal photo portfolio of different events in different dates.
I have an event.php page, where i want different sets of images to be loaded, depending on the event name and date.
I have already managed to change the page's title with this code:
<?php
$EventName;
function event ()
{
global $EventName;
return htmlspecialchars($_GET["EventName"]);
}
echo event();
?>
so that when i add ?EventName=whatever
it returns "whatever" to my page title.
I would like now to load a set of images, all from the same directory -which would be already created and in its place-.
I want to "call" the directory with the same type of function.
Is there a way to link to "evento.php?EventName=whatever", so that it loads a directory called "whatever", where i have the images stored? And so that if i change the name it will change the directory where the images are coming from (they would be named 1.jpg, 2.jpg, etc.)
Thank you so much, i'm struggling to find the right code but i find myself in trouble.
Bye!