Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

oh oh no: single login sign-in

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

oh oh no: single login sign-in

Postby sarjanajava » Thu Jan 30, 2003 10:07 am

i have database for login to store username and password
how do create a single login?

here is my coding FORM

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">

<title>Login Page!</title>
<body bgcolor=#FFGHFF">
<center><?php echo $errmsg;

<form method="post" action="loginsession1.php">
<table width="50%" border="1" cellspacing="0" cellpadding="0">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" name="submit" value="submit">
User avatar
New php-forum User
New php-forum User
Posts: 41
Joined: Wed Nov 27, 2002 10:59 pm

Postby Joan Garnet » Sat Feb 01, 2003 2:12 pm

Code: Select all

$user = $HTTP_POST_VARS["user"];
$passwrd = $HTTP_POST_VARS["password"];

$sql = "SELECT user_id, username, user_password FROM ".$table." where username='$user' and user_password='$passwrd'";
$sql_result= mysql_query($sql,$db);
if ($row = mysql_fetch_array($sql_result)){
      echo "You are logged in ".$user."!!";
   }while   ($row = mysql_fetch_array($sql_result));
   echo "You are not logged in....";
User avatar
Joan Garnet
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.