Sessions without cookies : forms
| From: | PHPCoder | Date: | Mon, 22 Jul 2002 06:36:44 +0000 |
| Subject: | Sessions without cookies : forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108828@lists.php.net to get a copy of this message | ||
Hi, thanks for all the replies on my two previous postings relating to sessions and cookies.
I have set my mind on using sessions but without cookies, so that entails passing the SID via relative URL's.
My problem comes in here, when I create a simple login page with a form that send username and password to the next page, I start_session(); and then in the form action, I append the url with <?=SID?> , but that causes two parse errors.
Warning: Cannot send session cookie - headers already sent by (output started at /home/www/index.php:3) in /home/www/index.php on line 4
Warning: Cannot send session cache limiter - headers already sent (output started at /home/www/index.php:3) in /home/www/index.php on line 4
The code is like so:
<html>
<head>
<?php
session_start();
?>
</head>
<body>
<form name="form1" method="post" action="admin_select_project.php?<?=SID?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#CFCFCF">
<td colspan="2">Admin Login
</td>
</tr>
<tr>
<td>Username:
</td>
<td><input type="text" name="username">
</td>
</tr>
<tr>
<td>Password:
</td>
<td><input type="text" name="password">
</td>
</tr>
<tr>
<td>
<input type="submit" name="Submit4" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
What am I missing...
Thanks