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

Jul 17, 2005

the script that show image is:

<?php
include('dbinfo.inc.php');

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";
$result=mysql_query($query);
mysql_close();

$file=mysql_result($result,0,"file");
$filesize=mysql_result($result,0,"filesize");
$filetype=mysql_result($result,0,"filetype");

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:

<?php
include('dbinfo.inc.php');

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";
$result=mysql_query($query);
mysql_close();

$file=mysql_result($result,0,"file");
$filesize=mysql_result($result,0,"filesize");
$filetype=mysql_result($result,0,"filetype");

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

ADVERTISEMENT

Error Code If Image Is Not Displayed?

Mar 31, 2007

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 View Related

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

Apr 27, 2011

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';
[code]....

View 2 Replies View Related

Image Is Not Displayed?

Jul 11, 2009

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.

[Code]...

View 3 Replies View Related

The Image Cannot Be Displayed, Because It Contains Errors

Aug 2, 2007

On running the following code :

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

/*We'll set this variable later.*/
$new_string;

/*register the session variable. */
session_register('new_string');
include ('mysql.php');
echo "<html>
<head>
<title> Forgot Username </title>
<link type="text/css" rel="stylesheet" href="css.css">
</head>
<body>
<form name="form1" action="" method="POST">
<fieldset>
<legend>Information</legend>
<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>
<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">
</label>
";
/* 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*/
srand((double)microtime()*1000000);

/*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");
ImageDestroy($im);
?>

It outputs :

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

View 1 Replies View Related

Image Can't Be Displayed Because It Contains Errors

Aug 2, 2010

Why is this code not working ?

[Code...]

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 View Related

Image Not Displayed In Ie And Chrome?

Apr 13, 2011

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 View Related

Why Isn't Image Being Displayed With TimThumb

May 5, 2011

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:

[Code]....

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 View Related

RSS Img Src Is Valid But No Image Gets Displayed?

Sep 7, 2010

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="http://www.yootheme.com/images/stories/blog/news_zoo21.jpg" 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='http://backend.userland.com/blogChannelModule'>
");

[Code].....

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 wrong....in 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 View Related

Onclick Image Displayed From DB?

May 10, 2011

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>";

[Code]....

View 1 Replies View Related

Image Is Not Displayed In The Browser?

Jan 25, 2009

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

Code:
http://shoutwire.com/submit?hip=1138&iw=138&ih=36&tc=-16777216&tpc=-5658199&bc=-1&bpc=-2894893&tp=Weave&bp=Wave&fs=15&hc=IbMevJzs4nw%3d

View 3 Replies View Related

Image Cannot Be Displayed In Firefox

Mar 31, 2007

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.

    <?php
        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 View Related

Never Gets Displayed Not Getting Any Error

Feb 28, 2010

i have got a problem with connecting to a mysql database using php. I used this package "mysql-noinstall-5.1.44-win32.zip" 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:

[code]...

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 View Related

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

Jan 6, 2011

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','127.0.0.1','/register')' at line 2

my code:

<?php
require_once("includes/database.php");
//Set timeout to 5 minutesp[code]....

View 2 Replies View Related

Image Created With Gd Are Downloaded Non Displayed!!!

Jul 28, 2003

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 View Related

Link Displayed Image To Function?

Jul 20, 2005

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

View 6 Replies View Related

CakePHP - Image Cannot Be Displayed Because It Contains Errors?

Aug 31, 2010

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 View Related

URL In Ajax - Counter Image Is Not Getting Displayed

Aug 11, 2009

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 View Related

Getting Image Gallery To Work With Displayed?

Jun 8, 2010

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?

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

[Code]...

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 View Related

Image File Not Being Displayed When Using My_sql_fetch_array?

Jun 2, 2009

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 View Related

Why Image Can't Be Displayed When Upload On Apache

Jun 23, 2009

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 View Related

Uploaded Image Displayed On Submit?

Oct 29, 2010

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

View 3 Replies View Related

Image Stored In Database Can't Be Displayed?

Feb 19, 2011

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 (
image_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
member_id INT UNSIGNED,
like_id INT UNSIGNED,
image LONGBLOB NOT NULL,
image_name varchar(255)  NOT NULL,

[Code]....

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

View 7 Replies View Related

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

Jun 15, 2009

Code:
<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 View Related

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

Jan 15, 2010

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 View Related

Page Displayed But With HTTP Error 500?

May 14, 2009

I am getting a HTTP error 500 error whilst trying to display my web page. The hosting company I am using is http://www.bytehost.com 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:

<?php

// Require the Smarty template file
require_once('inc/smarty/Smarty.class.php');[code]....

View 2 Replies View Related

Url Rewriting - Page Can Not Be Displayed, Getting Error?

Mar 25, 2010

I m using first time url rewriting concept..i m getting some errors when i used different symbols in url..$title="sachin's best shots KKR : MI ? "; here when i use normal text (with out any symbols) ..this is working fine..but, when i use (?,",',...page can not be displayed..getting error...

check the below code...
php code @ link
index-id-<?php echo $tr_id; ?>-name-<?php echo urlencode($title); ?>.htm[code].....

View 2 Replies View Related

Set Apache Error Displayed On Frontend?

Jan 2, 2011

when php scripts got error, the error usually goes to the apache error log (ubuntu setup).how can i config the server so that the error will be directly output to the page, just like XAMPP is doing.(the error i am referring to is php error. so that i can debug my php code easily)

View 3 Replies View Related

Change An Image That Is Displayed On The Screen Based On The Time Of Day

Apr 2, 2009

is there a way to change an image that is displayed on the screen based on the time of day. So when it becomes a certain time, the picture changes? I think its possible, but I just don't know where to start.

View 1 Replies View Related

HTTP Error 500.0 - Internal Server Error - Page Can't Be Displayed Internal Server Error Occurred

Dec 13, 2010

I use IIS 6.0 . I have a php file named try.php . content is as folows

[code]....

Error Summary HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred. Can anybody tell me what am i doing wrong... It happen with me almost every now and then.. Is there some conceptual mistake am doing?

View 8 Replies View Related

Cannot Connect To MySQL From It - No Error Message Is Displayed

Jul 24, 2010

I am trying to connect to mysql from php Below is the sample code i used.

<?php
<?php
$username = "root";
$password = "pwd";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
mysql_close($dbh);
?>

The problem here is I am not getting any error message. The page does not display anything. But when i comment the mysql_coonect() line i can see the prints and echo's. I tried checking if $dbh is valid and also tried putting the code in an exception block. But nothing helps. I have tried many variations of the above code to no effect. I am able to execute php scripts which shows that my php install is fine. I am also able to login to mysql db using (locaalhost, root,pwd) in command prompt and using mysql workbench.

Php version = php-5.2.13-win32-
MySql version = mysql-essential-5.1.48-win32

View 9 Replies View Related

Error Message Passed Through Url Not Displayed Correct?

May 23, 2011

'm trying to display error messages on the same page that submits a form (register_page.php). So in the script that executes the form submission, I create an array to hold all the error messages, and towards the end of the script I include a conditional at the end, which does the following if there are errors: First I convert the $errors array into a string, url encode it, then pass it into the url of the target page (register_page.php). Then on the target page, I retrieve the message through GET, url decode it, reconvert it to an array and try to print it out the contents of the array. So here is the excerpt of the conditional on the execution page:Display error messas.

} else { if errors array is not empty
Conver the errors array into a string
[code].........

View 1 Replies View Related

Database Record Misplaced Error Displayed In Field

Nov 23, 2010

Regarding my previous post: [URL]... I manage to correct that error. Now my problem is the misplacement of records on my fields. Records that suppose to be in the Region field now displays at the Name field. Records that should be on the Zipcode field now at the Age field. Records that should be on CPnumber field now displays at the Birthday field. It does displays the record though. Just dont know why i have this misplacement error in displaying the fields.

[code]...

View 6 Replies View Related

Force Loaded / Displayed Image To Link To An Html Page In Colorbox?

Sep 29, 2009

I'm using custom meta data to display images as a post in wordpress. When I click the image on my main page it opens in colorbox and this is perfect. WHAT IS HAPPENING : now, with the image loaded into the colorbox, when I click on the image it cycles through the images on my home page ( NOT what I would like ). WHAT I WOULD LIKE TO HAPPEN : with the image loaded into the colorbox, when I click on it, it will act as a link and load the post ( associated with that image ) into the colorbox. I'm not clear on how to do this. The code I'm using to display the image meta data for the posts is:

<?php
// check for spine image
$spine = get_post_meta($post->ID, 'spine image', $single = true);
// check for spine class

[code]....

So that the links with the attributes of 'bookmark' will open in the color box. How now can I make it so that the image in the colorbox links to the associated web page ( or act as a link to any web page... one step at a time )?

View 1 Replies View Related

Iframe Auto Size And Page To Serve As The Source For An Image To Be Displayed?

Mar 1, 2011

A php page named picture.php.In this page I am retrieving a certain image from the database where I used the following codes to display the retrieved image:

header("Content-Type: image/jpeg");
imagejpeg($img);
imagedestroy($img);

[code]...

Use this page to serve as the source for an image to be displayed in an iframe using the following code:

<a id="various3" href="picture.php" title="<?php echo $info; ?>">
<img class="last" src="./images/page11.jpg" />
</a>

[code]...

various 3 is a jquery class where when i click the tag various 3 will pop-up an Iframe with picture.php inside it and what i want to do is to set the size of the Iframe based on what is the size of the image from picture .php.

View 1 Replies View Related

Fatal Error Displayed When Accessing An Excel Application Using COM Object

Nov 11, 2009

I am trying to access a excel application using COM object but i am unable to access it. OS: windows, Php5.2.5

Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.application': Invalid syntax ' in C:xampphtdocsxls-xmlxls2xml.php:7 Stack trace: #0 C:xampphtdocsxls-xmlxls2xml.php(7): com->com('Excel.applicati...') #1 {main} thrown in C:xampphtdocsxls-xmlxls2xml.php on line 7

I have even tried with the below given source code by niroshan but it still displays the same error.

View 2 Replies View Related

Wordpress Checkbox For Specific Item (image Or Text) To Be Displayed On A Post Instead Of Custom Field?

Aug 31, 2010

we have about 10 things that need to be optional for each post and will be the same for the posts. They just need to be easily implemented on each post. Checkboxes would be ideal so the user can just select which items are displayed for that post.

View 1 Replies View Related

Submit Form Itself & Error Messages To Be Displayed If Fields That Are Left Blank By User On Submission?

Apr 7, 2010

I have a problem with form validation. I'm getting an error which I don't understand. Basically I want form to submit to itself & error messages to be displayed if fields that are left blank by user on submission.

HTML form first:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Form Validation</title>
</head>
[Code]...

View 4 Replies View Related

Displayed An "Adobe Reader" Error In Internet Explorer 8?

Jan 11, 2011

I have a section where users can upload documents into our software.The code itself is a couple years old and could perhaps use some updating, but it seems some of the files(at this time it only seems to be *.pdf)that have been uploaded are not able to be opened and the error "the file is damaged and could not be repaired" is being displayed as an "Adobe Reader" error in Internet Explorer 8.

The largest concern is that it is an irreversible error and many of the documents users have uploaded are now corrupt.I can't seem to find any relevant information from Google(or Adobe)that does anything towards resolving the problem.Note:This does not happen on every .pdf, and I am not sure if there is a common bond between the failing documents(trying to find this now).

View 3 Replies View Related

Apache Server Timeout With An Error Message "The Page Cannot Be Displayed" For A Script?

Sep 17, 2009

I'm trying to redirect output of a simple Perl script to a web browser using PHP.The Perl script sometimes take 2-3 hours to execute and show output to the screen.By this time, I guess Apache Server simply timesout and displays an error message discribed above.Here is the sample code snipet.

# The tmpOutput.txt contains output of a Perl script.
# Read a file using an handle.
$handle = popen("tail -f tmpOutput.txt", 'r');

[code]...

View 2 Replies View Related

PHP Pages Getting 404 Error, "Page Cannot Be Displayed"...

May 11, 2007

I tried putting this into the PHP Installation forum but don't get any answers or suggestions there so I'm going to try it here and hope it doesn't get moved.

I'm on a Windows 2003/PHP 5.22 setup.  I'm TRYING to upgrade from PHP 5.02 which did work on my server and quite well.  I followed the upgrading and installation instructions layed out on the PHP.net set -- I still can't get it to work.

The install dumped all the PHP related files under "c:program filesphp".  I've ensured that path is in my windows PATH statement for my env vars.  I've also verified that "c:program filesphpphp-cgi.exe" is in my Web Service Extensions listing in IIS and the status is set to "Allowed". 

From the command-line, I can execute my "test.php" file that has the phpinfo(); info function in it and it works fine.  It's only when I try to use my web browser to access the php file that I get the 404 error, "page cannot be displayed".  I know that IIS in general is working ok because I can point it to the default http://servername/iisstart.htm and it resolves to that page just fine.  It's only when I change it to http://servername/test.php (which has my phpinfo()) function in it when I get the 404 error.

My web server just doesn't seem to be interpretting PHP files anymore and I can't figure out why.

View 2 Replies View Related

No PHP Error. Just "Page Cannot Be Displayed"

Jul 17, 2005

I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system
is supposed to look up the email address and send the associated password to
that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it....

View 6 Replies View Related

Develop A Web Page That Is Displayed 30 Seconds When 30 Second Passed Next Page Is Displayed?

Jul 4, 2010

I want to develop a web page that is displayed 30 seconds when 30 second passed next page is displayed for this purpose I write following code.but it doesnot work properly.

<?php
session_start();
$_SESSION[‘timeout’]=time();
[code]....

View 6 Replies View Related

Mvc - Error Handling / $error[] = 'Image Could Not Be Uploaded, Check Filesize';?

Apr 28, 2010

We're building a PHP app based on Good old MVC (codeigniter framework) and have run into trouble with a massive chained action that consists of multiple model calls, that together is a part of a big transaction to the database.

We want to be able to do a list of actions and get a status report of each one back from the function, whatever the outcome is.

Our first initial idea was to utilize the exceptions of PHP5, but since we want to also need status messages that doesnt break the execution of the script, this was our solution that we came up with.

It goes a little something like this:

$sku = $this->addSku( $name );
if ($sku === false) {
$status[] = 'Something gone terrible wrong';
$this->db->trans_rollback();
return $status;
}
$image= $this->addImage( $filename);
if ($image=== false) {
$error[] = 'Image could not be uploaded, check filesize';
$this->db->trans_rollback();
return $status;
}

Our controller looks like this:

$var = $this->products->addProductGroup($array);
if (is_array($var)) {
foreach ($var as $error) {
echo $error . '<br />';
}
}

It appears to be a very fragile solution to do what we need, but it's neither scalable, neither effective when compared to pure PHP exceptions for instance.

Is this really the way that this kind of stuff generally is handled in MVC based apps?

UPDATE: Have done a fair share of googling and found this PHP Function: register_shutdown_function.
Could it be what we are looking for? I have no Idea and can't get it working the way we want it to...
Reference: http://php.net/manual/de/function.register-shutdown-function.php

View 1 Replies View Related

Image Upload Error While Using Function Imagecreatefromjpeg() - Fatal Error

Jun 18, 2009

I am resizing an image that is uploaded and I am creating a new image after resize using the function imagecreatefromjpeg() I have been able to successfully resize images of huge dimensions as well. But when I am try and upload an image having a size above 1.5 MB or so, I get the following error Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12288 bytes) The above error comes even if my image size is less than 2 MB Can anyone tell where am I going wrong here?

View 2 Replies View Related

ADVERTISEMENT