View Single Post
Old 11-10-2004, 11:47 PM   #8 (permalink)
arch13
Loves my girl in thongs
 
arch13's Avatar
 
Location: North of Mexico, South of Canada
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
arch13 is offline  
 

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