01-01-2008, 01:55 PM
|
#1 (permalink)
|
|
The Addict
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
|
[Solved] Cookies douesnt register why why !!!!!
hi
MY SCRIPT STAND ON THIS
FOR NOW I DONT CARE ABOUT SECURITY THATS WILL COME LATER
here is another problem that i had in my news script
here is the code
PHP Code:
<?php
if (!empty($_POST[name]) and !empty($_POST[pass]) ) {
include("config.php") ;
$result = mysql_query("select * from members") ;
while ($row = mysql_fetch_array($result) ) {
$id = $row[id] ;
}
$query = "select user from members where pass='$_POST[pass]'";
$res = mysql_query($query) ;
$count = mysql_num_rows($res) ;
if ($count == 1 ) {
if (!isset($_COOKIE[user]) and !isset($_COOKIE[pass]) ) {
$timestamp_expire = time() + 365*24*3600; // Le cookie expirera dans un an
setcookie('user', ($_POST['name']), $timestamp_expire); // On écrit un cookie
setcookie('pass', ($_POST['pass']), $timestamp_expire); // On écrit un autre cookie...
setcookie('id', $id , $timestamp_expire); // On écrit un autre cookie...
echo"<meta http-equiv='refresh' content='0;url=user_p.php' ";
}else{ echo"<meta http-equiv='refresh' content='0;url=user_p.php' "; }
}else{ echo "the nickname or password are false try again" ; }
}else{ echo "would you please full the forms" ; }
?>
but the cookie douesnt register and it gaves this error
PHP Code:
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\news\log2.php:1) in C:\wamp\www\news\log2.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\news\log2.php:1) in C:\wamp\www\news\log2.php on line 11
 so whats the problem !!
Last edited by webtuto : 01-04-2008 at 06:03 PM.
|
|
|