Jump to content

karlclef

Members
  • Posts

    4
  • Joined

  • Last visited

karlclef's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. dauruk0512 , i just tried your code, yours is also working.Thanks
  2. Thanks a lot, i have been able to fix the problem by the help of your kind suggestions.This really helped.
  3. 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_ID from Customer where 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_ID from Restaurant where 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?
×
×
  • Create New...