problem with session_start
| From: | Roy Kaldung | Date: | Wed, 05 Dec 2001 10:45:35 +0000 |
| Subject: | problem with session_start | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76691@lists.php.net to get a copy of this message | ||
Hello,
after execution of session_start, the browser (IE) tries to save the
document
instead of viewing the pdf-file. After removing the line with
session_start()
all works fine.
configuration: Linux(2.4.2), Apache 1.3.22, PHP 4.0.6, PDFlib 4.0.1.
Any thoughts?
Bye
Roy
<?php
//get session_id from the URL, it's coded into the path
ereg("/([0-9a-z]{32})", $REQUEST_URI, $regs);
$session_id = $regs[1];
session_id($session_id);
session_start();
// create pdf-document
$p = PDF_new();
PDF_open_file($p, "");
PDF_set_info($p, "Creator", "test.php");
PDF_begin_page($p, 100,100);
PDF_end_page($p);
PDF_close($p);
// start output
$buf = PDF_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-length: $len");
print $buf;
PDF_delete($p);
?>