Jump to content

Archived

This topic is now archived and is closed to further replies.

ignace

calling files with parameters in an href/src

Recommended Posts

i have been working with asp, and now am i trying to do something what i thought was possible!

[code]
<img src="image.php?f=an_image.gif" width="105" height="105" />
<!-- however when i load the page no image is being displayed, does anyone know what i did wrong? or what i am forgetting? -->
[/code]

thx in advance, i'm still looking into the problem so it might be that i'll find it in my next google search, but i appreciate any help :D

Share this post


Link to post
Share on other sites
Please post the source of the image.php script. We nned to see that.

Ken

Share this post


Link to post
Share on other sites
the code as requested:

images.php
[code]
<?php
# images.php
if (!function_exists("getMediaType"))
{
include "../components/functions.php";
}

# declare/initialise variables
$Img    = $_REQUEST['f'];
$Folder = "../media/images/";
$Ext    = explode(".", $Img);
$MT     = getMediaType(array_pop($Ext));

if ($MT <> "")
{
# change to the correct folder
chdir("{$Folder}");

# submit header information
//header("content-type: image/{$MT}");
//header("content-disposition: attachment; filename={$Name}");

# read the file to assure the file and his content is being submitted.
readfile("{$Name}");
}
?>
[/code]

index.php
[code]
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- W3C XHTML 1.0 Strict Standard Template -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl" lang="nl">

<head>
<title>laboratory :: sticking needles up php's ass</title>
<meta http-equiv="robots" content="noindex,nofollow" />
<meta http-equiv="pragma" content="nocache" />
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<meta http-equiv="content-style-type" content="text/css" />
</head>

<body>
<img src="modules/images.php?f=an_image.gif" width="105" height="105" /><br />
</body>
</html>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.