Jump to content


Photo

calling files with parameters in an href/src


  • Please log in to reply
2 replies to this topic

#1 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 29 October 2006 - 04:10 PM

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

<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? -->

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

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 29 October 2006 - 04:38 PM

Please post the source of the image.php script. We nned to see that.

Ken

#3 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 29 October 2006 - 04:59 PM

the code as requested:

images.php
<?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}");
}
?>

index.php
<?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>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users