can anyone help me out with my session problem, the code connects to the Database fine its just the session that doesn't seem to work,
<?
if ($submit = "Login")
{
mysql_connect("localhost", "username", "password") or
die ("Could not connect to database");
mysql_select_db("DATABASE") or
dir ("Could not select database");
$result=mysql_query("select * from users where username='$username'")
or die ("cant do it");
while ($row=mysql_fetch_array($result)) {
if ($row["password"]==$password )
{
session_start();
$_session = "98127398abasdfiu98123nius";
echo"Successfully Logged In!";
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
}else
{
echo"Nope";
}
}
}
?>[/COLOR]
the following error appears when its run
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/edinburg/public_html/admin01/login.php:9) in /home/edinburg/public_html/admin01/login.php on line 25
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/edinburg/public_html/admin01/login.php:9) in /home/edinburg/public_html/admin01/login.php on line 25
can anyone help out, my coding is prob very bad, lol, kinda new at sessions
thanks