Jump to content

Image Include Script


Iryk

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?
Link to comment
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..
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.