Image Cannot Be Displayed, Because It Contains Error ...

Jul 17, 2005

the script that show image is:


@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";


header('Content-Type: '.$filetype);
header("Content-Disposition: attachement
print $file;

it's work fine execpt it show the image as a attachement (Save as... window), so Apache, mysql, php seem to work fine. the problem is only on http header of image i think.
i want the image directly so, i use this:


@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";


header('Content-Type: '.$filetype);
print $file;

it's don't work, firefox gave me "The image http://ip:8080/viewimage.php cannot be displayed, because it contains error." IE show me nothing at all.

any one have a idea ?

Windows NT 5.1 build 2600 (XP Professional English)
Apache 2.0.54, running as a server
PHP Version 5.0.4 running as module
MySQL 4.1.7 (a dll from php)
Firefox english 1.0.4
Internet Explorer 6

View 7 Replies


Error Code If Image Is Not Displayed?

Is there a way or making an error code of some sort that's raised when an image isn't there? Rather than display a boxed "X" or a broken picture.

View 1 Replies

Pchart Zend Framework Error "The Image Cannot Be Displayed Because It Contains Errors?

Am using pchart to create charts for a zend framework application. My problem is that i cant get the application to display the chart as each time am getting the above named error. I have looked at the various solutions related to the problem but i its still not working. Is there anything that am missing here?

require 'pChart2.1.1/pChart2.1.1/class/pData.class.php';
require 'pChart2.1.1/pChart2.1.1/class/pDraw.class.php';

View 2 Replies

Image Is Not Displayed?

I have created a form that inputs text and an image into a web page. The text updates fine but the image doesnt show. Can anyone see the what I am doing wrong?

The text and image are extracted from two different mysql tables photographs and cms_careshowkit. When the user clicks on the submit button they are taken to a list of hyperlinks referring to pages they can view. When They click on the page they have just updated it should show the new text and image.


View 3 Replies

The Image Cannot Be Displayed, Because It Contains Errors

On running the following code :

/* initialize a session. */
Header("Content-Type: image/png");

/*We'll set this variable later.*/

/*register the session variable. */
include ('mysql.php');
echo "<html>
<title> Forgot Username </title>
<link type="text/css" rel="stylesheet" href="css.css">
<form name="form1" action="" method="POST">
<label class="left">E-mail Address :<br>
<font size="-2"> This is the address you provided during registration </font></label>
<label class="right">
<input type="text" name="email">
<label class="left">Enter the code as you see in the box :<br>
<font size="-2"> Case Sensitive </font></label>
<label class="right">
<input type="text" name="image"> <img src="verify.png">
/* set up image, the first number is the width and the second is the height*/
$im = ImageCreate(200, 40);

/*creates two variables to store color*/
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);

/*random string generator.*/
/*The seed for the random number*/

/*Runs the string through the md5 function*/
$string = md5(rand(0,9999));

/*creates the new string. */
$new_string = substr($string, 17, 5);

/*fill image with black*/
ImageFill($im, 0, 0, $black);

/*writes string */
ImageString($im, 4, 96, 19, $new_string, $white);

/* output to browser*/
ImagePNG($im, "verify.png");

It outputs :

The image “http://vsenepal/account_settings.php” cannot be displayed, because it contains errors.

View 1 Replies

Image Can't Be Displayed Because It Contains Errors

Why is this code not working ?


I always get error The image cannot be displayed because it contains errors.. I've already enabled php_gd2.dll and memory_limit in php.ini is also 128M. If i remove header('Content-type: image/png'); i don't get the error but i don't see the image either. All i see is this

View 5 Replies

Image Not Displayed In Ie And Chrome?

I have an image tag in which i have given src attribute to[URL]

<img width='100' height='75' border='0' src='../attachment.php?attachmentid=$picture[attachmentid]&amp;thumb=1'/>

It displays properly in firefox but when i check in ie & chrome the image is not displayed. I even tried to copy the url & then execute it directly in the browser same thing happened. This thing is happening in wordpress php exec widget.I am unable to find out the cause for this.

View 1 Replies

Why Isn't Image Being Displayed With TimThumb

I am using TimThumb at [URL] When I use the following url: [URL] Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 10368 bytes) in /hermes/web02/b399/------/jquery_custom/create_user_image.php on line 377

I have adjusted the memory_limit to "5000MB" in my php.ini file and in the TimThumb code I adjusted the code to the following:


The picture itself is only 2.23 MB, the last time I checked that wasn't that big lol. So I need help!

View 1 Replies

RSS Img Src Is Valid But No Image Gets Displayed?

I've re-engineered my PHP script to produce a RSS XML file.

The RSS file validates fine via [URL]

Unfortunately images don't show for some reason and I can't quite pin down why.

The part of the RSS which displays the image is this:

<description><p><img src="" width="200" height="200" align="middle" /></p> </description>

The header of the RSS which I'm writing is as:

fwrite($rss_data_write, "<?xml version='1.0' encoding='iso-8859-1'?>
fwrite($rss_data_write, "<rss version='2.0' xmlns:blogChannel=''>


As far as I'm aware the above code is valid and should display the image in img src etc.

I've compared the code to other RSS feeds and it would seem I'm doing nothing theory.

I'm inclined to believe that either the namespace is being defined problematically or somehow chars are getting inserted somehow which somehow makes any RSS reader fall over when displaying an image.

In IE8 the RSS field yields an image placeholder as if the link was invalid (except it's not), in other RSS reader it simply doesn't display the image at all.

View 5 Replies

Onclick Image Displayed From DB?

I created a postgresDB with maps(.jpg) and additonal information about them such as "area,theme,type,language,date,creator,...etc"

I created a form with 4 drop-down options for "area,theme,type,language" and a "submit" button.After a query you can receive a table of results with the maps in small size and some of the additional information(not all).

I want to click on one of the the displayed images(map), open it in a new page enlarged and with all the rest aditional information from the database. I tried it with <a href=$imageurl> but only i can do is to enlarge the image without putting the information See bellow the resultpage.php code, at the "echo" part.

while($row =pg_fetch_array($result, null, PGSQL_ASSOC))
echo "<tr>";
echo "<td align='center'>" . $row['title'] . "</td>";
echo "<td align='center'>" . $row['area_name'] . "</td>";
echo "<td align='center'>" . $row['type_name'] . "</td>";


View 1 Replies

Image Is Not Displayed In The Browser?

I have a following captcha image link...currently, the image is not displayed in the browser...instead it asks me to do i make it to display in the browser?any PHP code for that?


View 3 Replies

Image Cannot Be Displayed In Firefox

I finally managed to get the gd2 libary installed on my server and started to look @ the gd tutorial on phpfreaks. I copied and pasted the code to see what would happen.

header ("Content-type: image/png");
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color);
ImagePng ($img_handle);

I get this when I try and view the image in firefox. The image path/img.php cannot be displayed, because it contains errors. And in ie it tries to load the image via quicktime?

View 2 Replies

Never Gets Displayed Not Getting Any Error

i have got a problem with connecting to a mysql database using php. I used this package "" and extracted it to c:mysql and added c:mysqlin to the PATH variable and used the following command in command prompt to start mysql: c:mysqlinmysqld --standalone. well mysql did start and everything went well accessing mysql in command prompt. Well under the database "mysql" in the table "user" i created a new user "php" with a password="****" and hostname = "localhost" but when i try to access this database with a following php routine:


and when i accesses it with my browser using localtost/test.php, all i get is "localhost" displayed on screen, "Connected to mysql" never gets displayed not i get any error. note: i am using windows 7(32-bit-ultimate)and mysql 5.1.44.

View 8 Replies

Error Being Displayed: You Have An Error In Your SQL Syntax; ....?

I am getting an error message in my php query.Error being displayed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1294251744','','/register')' at line 2

my code:

//Set timeout to 5 minutesp[code]....

View 2 Replies

Image Created With Gd Are Downloaded Non Displayed!!!

I use a gd function for create png image for show graphs, but some user told that is unable to see the graph but the PC ask for download the image.

View 4 Replies

Link Displayed Image To Function?

is there a way to link an image displayed to a function? Code:

View 6 Replies

CakePHP - Image Cannot Be Displayed Because It Contains Errors?

While serving images through CakePHP, I'm getting

The image [URL] cannot be displayed, because it contains errors.

There is a bug report already existing, [URL]

As mentioned in the above bug report, whitespace is the culprit here. Can someone throw some light upon where exactly I have to look for these white spaces? I've checked at the end of all my files, there are no white spaces. So where else should I be checking for these white spaces?

View 2 Replies

URL In Ajax - Counter Image Is Not Getting Displayed

When I open my site without "www", like [URL], then there is a problem with my website hit counter on the home page, which is done through AJAX. The problem is that counter Image is not getting displayed. It is showing blank. There are similar problem on other pages where I have used AJAX to retrieve data.

View 2 Replies

Getting Image Gallery To Work With Displayed?

This code i used from a php teaching book allows me to have an image galery with thumbs that will display on a main image placeholder. Unfortunately, when I have it in this order, my captions that show below the main display do not change to be with the image displayed unless i have the do loop executed before the main image holder is executed. How do i get this to work so that i can have my main image display above my table of thumbs?

//connection to the database
define('COLS', 2);
define('SHOWMAX', 2);
$conn = dbConnect('query');
$getTotal = 'SELECT COUNT(*) FROM images';
$total = $conn->query($getTotal);
$row = $total->fetch_row();


p.s. the arrow i made is where im pointing to about the do loop. So when using the code to figure it out, delete the arrow i made.

View 1 Replies

Image File Not Being Displayed When Using My_sql_fetch_array?

I'm just getting into PHPMySQL and I have hit an issue with displaying a sql query. What I'm trying to do is create a gallery, so there is a table that has the following in it:

| photo_id | photo_filename | photo_caption | photo_category |

The code in use to display the query is:

PHP Code:

while($row = mysql_fetch_array($result)) {
echo "imageID" . " " . $row['photo_id'] . "<br />";
echo "image" . $row['<img src='."photo_filename".'>'];
echo "<br />";
echo "image_caption" . " " . $row['photo_caption'];

When running executing the page, only the image file is not displayed.

How do I get php to get the image name inserted into the <img> tag in the echo?

View 7 Replies

Why Image Can't Be Displayed When Upload On Apache

I create a php form that lot oif image in it and it can display to my computer but when i upload to the apache it cant show the image already why this will happen?

View 4 Replies

Uploaded Image Displayed On Submit?

send me a complete code to upload a picture and then have it displayed on form submit or page refresh.

View 3 Replies

Image Stored In Database Can't Be Displayed?

I put together the following blocs of code for uploading pictures into a database and displaying them on a webpage. The pictures are supposed to be displayed on the member's only page of a website I'm working on, upon logging in, and they are supposed to be the member's uploaded picture. I created several members and and used one of my existing member accounts to test the uploading process. The picture upload process appeared to have been successful when I checked on myphpadmin. Yet, when I login with this account, no picture is displayed, instead, a tiny jpg icon is displayed at the top left corner of the box in which the picture was supposed to be displayed. Same thing when I login with the other accounts with which I haven't yet uploaded a picture.

I'll start with the code that installs the table in the database

$query = "CREATE TABLE images (
member_id INT UNSIGNED,
image_name varchar(255) NOT NULL,


Now the million dollar question is, "What is preventing the picture from getting displayed?"

View 7 Replies

$_GET - Display A Default Image If No 'id' Is Displayed In The URL?

<img src="/inc/images/<?php print $_GET['id'];?>.jpg" alt="Requested Image">

My question is, what is the easiest way to display a default image if no 'id' is displayed in the URL? Do I need to bring some if and else into play?

View 7 Replies

Image Isn't Displayed In The Page When Accessed From The Browser

I created a layout page in which I have this :

<img src="images/header.jpg" width="790" height="228" alt="" />

but the image isn't displayed in the page when accessed from the browser. I put the file header.jpg in the web/images/ folder. I thought I could learn Symfony in a week while working on a small project. is it possible ?

View 2 Replies

Page Displayed But With HTTP Error 500?

I am getting a HTTP error 500 error whilst trying to display my web page. The hosting company I am using is and they are running PHP 5.2.9.I am using this free host for a college project, but I do have my own paid hosting. The thing is, it displays correctly on my own hosting, which is also on PHP 5.

The page I am trying to display is using the Smarty templating engine. The error seems to be with the display() method of the Smarty() class, because when I commented it out, the page displayed but with PHP errors.Here is my index.php code:

PHP Code:


// Require the Smarty template file

View 2 Replies

Copyrights 2005-15, All rights reserved