Solved

CGI Error about HTTP headers

Posted on 2006-07-05
6
266 Views
Last Modified: 2008-03-04
Hello

I'm trying to retrieve image from Oracle using php.
My code sometimes works, but sometimes returns error bellow.
What's wrong with this code.
Please help me.

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Code:

<?php
      require_once('db_connect.php');
      $table = 'fnsonld.emp_emp';
      $fldblob = 'PHOTO';
      $fldid = 'EMPID';
      $valid = '16';

      $query = 'SELECT '.$fldblob.' FROM '.$table.' WHERE '.$fldid.'='.$valid;
      $stmt = oci_parse ($conn, $query);
      oci_execute($stmt, OCI_DEFAULT);
      $arr = oci_fetch_assoc($stmt);
      $result = $arr[$fldblob]->load();
      
      header("Content-type: image/JPEG");
      echo $result;
      oci_free_statement($stmt);
      oci_close($conn); // log off
?>
0
Comment
Question by:jambuul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 125 total points
ID: 17040987
I've had these errors myself. I guess you're running windows? It's a knows CGI bug. Use ISAPI to get rid of the error.
0
 

Author Comment

by:jambuul
ID: 17041024
tnx,
How can I install PHP5 ISAPI on WinXP SP2?
I don't know about it.
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 17041137
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 29

Expert Comment

by:TeRReF
ID: 17048638
May I ask why you gave me a C grade?
0
 

Author Comment

by:jambuul
ID: 17048656
I didn't manage configure PHP5 ISAPI on WinXPSP2.
I'm still using CGI.
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 17048693
That's too bad :(
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question