Hey PHP Programmers,
I really need some help with this error. Im trying to make a login type script that saves your name, and increments by 1 , how many times you vist the site.
For some reason when i set session_start(); and the setcookie(); i get errors.
heres my code...
Code:
<html>
<head>
<title> Login. </title>
<h2> Login Screen.</h2>
<?PHP
session_start();
$_SESSION['count'] = $_SESSION['count'] + 1;
print "You've looked at this page " . $_SESSION['count'] . ' times.';
?>
<p></p>
<img src="login.jpg">
<?php
$browser = get_browser( );
if ($browser->platform == 'WinXP') {
print '<p></p><b>You are using Microsoft Windows XP Operating System.</b><p></p>';
} elseif ($browser->platform == 'MacOSX') {
print 'You are using the Mac OS X.';
} else {
print 'You are using a different operating system. this page , may or may not show.';
}
?>
<form method="POST" action="sayhello.php">
Your Name: <input type="text" name="user">
<br/>
<input type="submit" value="Say Hello">
</form>
</head></html>
Error:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at E:\Xampp\htdocs\xampp\aricsphp.php:8) in E:\Xampp\htdocs\xampp\aricsphp.php on line 10
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:\Xampp\htdocs\xampp\aricsphp.php:8) in E:\Xampp\htdocs\xampp\aricsphp.php on line 10
You've looked at this page 1 times.
what am i doing wrong?
Once Again,
Thanks for your help, i really appreciate it.