Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session problems

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
US
Hi. I call this script to extract and display pdf files stored as blobs in Oracle 8, using

deliver.php?REPORT_KEY=some_number_here.

<?
header(&quot;Content-type: application/pdf&quot;);
$db = OCILogon(blahblahblah);
$stmt = OCIParse($db,&quot;select report from reports where report_key=$REPORT_KEY&quot;);
OCIExecute($stmt);
OCIFetchInto($stmt,&$arr,OCI_ASSOC);
echo $arr[&quot;report&quot;]->load();
?>

It works fine, displaying the pdf in the browser using adobe acrobat reader.
However, I want to add our session vars to this page, and when I put session_start() anywhere in this script, it bombs out (even if I don't register any variables). When I click the link to call the script, it gives me a download dialogue box for some reason, and if I click &quot;save as&quot; I get an error message saying that the server is unavailable. Nothing appears in the error log.

Please save my sanity! Is there a conflict between the content-type and session-handling stuff?
Oddly enough, I got this to work on a different server but same version of RedHat, Apache, and PHP. Hmmmmmm...

Thanks for any help! Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
did you turn on the session in the php config file ?
 
You should be able to place session_start(); directly after your header() call:

header(&quot;Content-type: application/pdf&quot;);
session_start();

Chad. ICQ: 54380631
online.dll
 
Yes, I've tried that, but it still doesn't work.

We're also using SSL on that server, and I think that may be what's causing the problem. But I have no idea what to do about it.

Thanks for your help, and if anyone has any further suggestions, please don't hesitate to post them!! Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top