Jump to content

Archived

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

Iryk

Image Include Script

Recommended Posts

[code]<?
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.");
?>[/code]

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?

Share this post


Link to post
Share on other sites
[!--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..

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.