Jump to content


Photo

Image Include Script


  • Please log in to reply
1 reply to this topic

#1 Iryk

Iryk
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 25 March 2006 - 04:27 AM

<?
require_once("db_connect.php");
$query = mysql_query("SELECT * FROM site");
$result = mysql_fetch_array($query);
$image_1 = $result['banner'];
$image_2 = imagecreatefrompng("$image_1");
imagepng(".$image_2.");
?>

That is my code. And this is the error I get on the page:

Warning: imagecreatefrompng(None Yet): failed to open stream: No such file or directory in /home/magneo/public_html/banner.php on line 6

Warning: imagepng(): supplied argument is not a valid Image resource in /home/magneo/public_html/banner.php on line 7

Could some one please tell me what I am doing wrong?

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 25 March 2006 - 07:31 AM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?
require_once("db_connect.php");
$query = mysql_query("SELECT * FROM site");
$result = mysql_fetch_array($query);
$image_1 = $result['banner'];
$image_2 = imagecreatefrompng("$image_1");
imagepng("$image_2");
?>[/quote]

You put . before and afte rthe variable name inside a string so it would look like your trying to echo the .'s as part of the vpng to display therefore totaly corupting it..
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users