karlclef
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by karlclef
-
-
User above
-
Thanks a lot, i have been able to fix the problem by the help of your kind suggestions.This really helped.
-
Please, when i run the below php code it shows the following errors:
Notice: Undefined index: uid in C:
Notice: Undefined index: upass in C:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:
HERE is the code:
if (!isset($_POST['role']) or $_POST['role'] == 'user') {
if (isset($_POST['logout']) && $_POST['logout'] == 'yes') {session_start();session_end();set_session_cookie('uname', '');exit;}$user = mysql_fetch_assoc(mysql_queryf("select Cust_Name, Cust_IDfrom Customerwhere Cust_ID = %s and Passwd = %s", $_POST['uid'], $_POST['upass']));if ($user) {session_start();$_SESSION['uid'] = $user['Cust_ID'];set_session_cookie('uname', $user['Cust_Name']);}} elseif ($_POST['role'] == 'rest') {if (isset($_POST['logout']) && $_POST['logout'] == 'yes') {session_start();session_end();set_session_cookie('rname', '');exit;}$user = mysql_fetch_assoc(mysql_queryf("select Rest_Name, Rest_IDfrom Restaurantwhere Rest_ID = %s and Passwd = %s", $_POST['rid'], $_POST['rpass']));if ($user) {session_start();$_SESSION['rid'] = $user['Rest_ID'];set_session_cookie('rname', $user['Rest_Name']);}} else exit;?>Any Help to fix it?
PHP script showing undifined index error
in PHP
Posted
Thanks