Solved

CGI Error about HTTP headers

Posted on 2006-07-05
6
261 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

10 Experts available now in Live!

Get 1:1 Help Now