Hi there, like jlhaslip im not entirely sure what youre after but ill take a shot and hpefully i can help abit.
i think i get what you mean. for example with the image code you posted you want the imnage to change depending on what the user inputs? so you could have a link that goes to a page like www.site.com/
page1.php?image=1 and image one would be loaded up, but if they clicked a link like www.site.com/page1.php?image=
2 image two would be shown? right?
if so you could do what i have done on my website. First of all follow the link given to you and learn about the include function. it will make things easier to learn and understand. then you would need code something like:
(assuming that you use the url like www.site.com/
page1.php?image=1)
CODE
//get the value in the url into a variable
$image = $_GET['image'];
//use include to put this file onto page1.php
include($image);
im not sure how well include handles images as ive only ever used it to include php and html files. but if you wanted to use this to load different content (eg like trap17.com does with index.php?act=something and load a different content depending on the act. EG act=post lets the php know its looking at a forum post.) then you would use the code above but add something to it like:
CODE
//get the value in the url into a variable
$image = $_GET['image'];
// add ".html" to filename
$html = ".html";
$image = "$image$html";
//now $image is something like 1.html
//use include to put this file onto page1.php
include($image);
so if 1.html was a picture gallery the user would see a picture gallery. And if 2.html was a contact form they would see the contact form.
for better explainations check the link given to you, i just hope this is easier to understand because i sometimes find php manuals and such like to be hard to understand.
Reply