Hi,
I'm trying to send my session ID using POST/GET auto-inserted by PHP.
This works like a charm in a .php file. But in a .cgi file, a new
PHPSSID appears in the Address field of my browser every time I follow
the link from the file to itself.
What may be causing this? I have had some big problems sending cookie
headers from .cgi files like this. So I want additional stuff to stay
out of my header. It was my ISP who told me to explicitly write the
Content-type line.
Here's my code:
#! /usr/local/bin/php
<?php
ini_set ("session.use_cookies", "0");
ini_set ("session.use_only_cookies", "0 ");
session_start();
print 'Content-Type: text/html' . "\n\n"; // required in .cgi file
print '<html><body>' . "\n";
if (!isset($_SESSION['count']))
$_SESSION['count'] = 1;
else
$_SESSION['count']++;
print 'Visit number ' . $_SESSION['count'] . '<br>';
print '<a href="test5.cgi"> Go again </a>';
print '</body></html>' . "\n";
?>
Greetings,
B�rge
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php