01-02-2008, 11:17 AM
|
#5 (permalink)
|
|
The Addict
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
|
PHP Code:
<?php
ob_start()
if (!empty($_POST[name]) and !empty($_POST[pass]) ) {
error_reporting(E_ALL);
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" ; }
ob_end_flush()
?>
the script become like that right
but it gaves error
PHP Code:
Parse error: syntax error, unexpected T_IF in C:\wamp\www\news\log2.php on line 3
|
|
|