<?php
if(isset($_POST['login']) AND isset($_POST['password'])){
$username = addslashes($_POST['login']);
$username = htmlspecialchars($username);
$password = addslashes($_POST['password']);
$password = htmlspecialchars($password);
$passwordm = md5($password);
$passwordmd5xx = "XXXXXXXXXX".$passwordm;
if(!empty($username) AND !empty($password)){
include('../includes/functions.php');
$query = mysql_query("SELECT * FROM `users`
WHERE user_login='".$username."'
AND user_pass='".$passwordm."'
AND user_status='1'") or die ("Query failed");
$counts = mysql_num_rows($query);
if($counts == 0){ include('index.php');
}else{
$rows = mysql_fetch_array($query);
setcookie("user_id",$rows['user_id'],time()+14400);
setcookie("user_pass",$passwordmd5xx,time()+14400);
echo "<META HTTP-EQUIV='refresh' CONTENT='1; URL=tools.php'>";
mysql_close($connectdb);
}
}else{
include('index.php');
}
}else{
include('index.php');
}
?>
i'm using this code to connect into my panel administration... for some reason there is no cookies set when i'm try to login... ( no cookies => no login ) when i debug the $_COOKIE it return an empty array !! this code work just fine in localhost and the stranger thing it work also in another web server, but not in this web server that i'm using actually... i can't understand where is the problem ?! any suggestion are welcome
thank you