Solved

CGI Error about HTTP headers

Posted on 2006-07-05
6
264 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
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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.

830 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