theFez and irseg, those both worked great.
now if I call a php file that contains a table with a new variable code block, I can call that second variable using the same script in the included file and by changing the line $id = $_GET['id']; to $id = $_GET['id2'];
and using the url syntax ?id=main.php&id2=arch13tag which would cause the line
if(file_exists($id.".jpg")) {
echo "<img src='$id.jpg'>";
to see that arch13tag is a jpg and echo it into the included pages table right?
I blended your code to reach a solution. the code reads as follows and works great so far though I haven't tried double variables yet:
$id = $_GET['id'];
if(file_exists($id.".jpg")) {
echo "<img src='$id.jpg'>";
} elseif(file_exists($id.".php")) {
include($id.".php");
}
else{
echo "<img src=\"path/to/mydefautlimage.jpg\">";
//or echo "<img src=\"$id\">"; if you want to pass the name of the jpg dynamically
}
Thank you guys for your help!
__________________
Seen on an employer evaluation:
"The wheel is turning but the hamsters dead"
____________________________
Is arch13 really a porn diety ? find out after the film at 11.
-Nanofever
|