this is part of login.php:
<?php
ob_start();
$con = mysqli_connect('localhost', 'root', 'xxxxxx');
if ($con) { mysqli_select_db($con, 'admininfo');
$user = $_REQUEST["_user"];
$pass = $_REQUEST["_pass"]; }
else { echo '<br><br>Error...'; }
$query = mysqli_query($con, "SELECT passwords FROM adminlist WHERE username='$user'");
if (mysqli_num_rows($query) == 1) { $nam = 1; }
else { $nam = 0; }
$dbarray = mysqli_fetch_array($query,MYSQLI_BOTH);
if ($pass == $dbarray['passwords']) { $pas = 1; }
else { $pas = 0; }
if ($nam == 1 && $pas == 1) {
//session_start();
setcookie('uid', $user, time() + 14400, '/'); //$_SESSION['uid'] = $user;
}
?>
<html>
<head>
<title>asd</title>
<?php
if ($nam == 1 && $pas == 1) {
echo '<meta http-equiv="refresh" content="3; URL=http://localhost/ad.php">';
}
else { echo '<meta http-equiv="refresh" content="3; URL=http://localhost/adminlogin.php">'; }
?>
=============================================================================
this is what the ad page show when the login page redirected to ad.php:
Notice: Undefined index: uid in C:\htdocs\ad.php on line 3
ad.php code:
<?php
//session_start();
echo $_COOKIE['uid'];
//echo $_SESSION['uid'];
?>
==============================================================
what is the problem??
when i use the SESSION or cookies it resulting the same "Notice: Undefined index: uid in C:\htdocs\ad.php on line 3"
for your information im using:
1) PHP 5
2) Apache 2.2.4
3) MySQL 5
should i need to change some parameters in php.ini??
i really apperciate your help... thank u...