Solved

CGI Error about HTTP headers

Posted on 2006-07-05
6
262 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now