Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

error image_window.php

Contributor ,
Mar 14, 2007 Mar 14, 2007
i have this script : image_window.php which keeps giving me this error :

-This script must receive a valid image name!
Close This Window

when i open images.php , everything's fine , as you can see by clicking this link : http://therainbowpride.com/myphp2/images.php

This is my script, i looked over and over and just can't seem to find where is the error, could it be a space ?
Can someone have a look at it , maybe an extra pair of eyes would help me. Thank you so much

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>View Image</title>
</head>
<body>
<?php # Script 11.3 - image_window.php

// Set a variable for problem reporting.
$okay = FALSE;

// Make sure an image name was passed to the script.

if (isset($_GET['image'])) {

// Get the extension of the image name.
$ext = substr ($_GET['image'], -4);

// Test if it's a valid image extension.
if ((strtolower($ext) == '.jpg') OR (strtolower($ext) == 'jpeg') OR (strtolower($ext) == '.gif')) {

// Get the image information and display the image.
if ($image = @getimagesize ('uploads/' . $_GET['image'])) {
echo "<img src=\"uploads/{$_GET['image']}\" $image[3] border=\"2\" />";
$okay = TRUE; // No problems.
}

} // End of extension IF.

} // End of isset() IF.

// If something went wrong...
if (!$okay) {
echo '<div align="center"><font color="#FF0000" size="+1">This script must receive a valid image name!</font></div>';
}
?>
<br />
<div align="center"><a href="javascript: self.close();">Close This Window</a></div>
</body>
</html>






TOPICS
Server side applications
279
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Mar 14, 2007 Mar 14, 2007
Problem solved. I've decided to take a 30 minute break and when i came back i found out that in my images.php script i had the '$' sign missing before 'image'.

Thank you guys
Translate
Contributor ,
Mar 14, 2007 Mar 14, 2007
LATEST
Problem solved. I've decided to take a 30 minute break and when i came back i found out that in my images.php script i had the '$' sign missing before 'image'.

Thank you guys
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines