allahverdi
08-13-2007, 06:07 AM
Hello
I have on login script (if, else)
here is my script:
<?php
require_once 'config.php';
require_once 'functions.php';
$errMsg = '';
if (isset($_POST['txtUserid'])) {
// Check the user login. For now we only check it
// against a hardcoded value
if ($_POST['txtUserid'] == 'azservice' && $_POST['txtUserpw'] == 'azservice') {
$_SESSION['isLogin'] = true;
header('Location: admin.php');
exit;
}
else {
$errMsg = "Wrong Id/Password";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p> </p>
<?php
if ($errMsg != '') {
echo '<p align="center"><font color="#990000">' . $errMsg . '</font></p>';
}
?>
<form action="" method="post" name="frmCampaign" id="frmCampaign">
<table align="center" width="500" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>User Id</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserid" type="text" id="txtUserid" value=""></td>
</tr>
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>Password</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserpw" type="password" id="txtUserpw" value=""></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
there is no problem now buy i need to make 2 users:
if (isset($_POST['txtUserid'])) {
if ($_POST['txtUserid'] == 'azservice' && $_POST['txtUserpw'] == 'azservice') {
$_SESSION['isLogin'] = true;
header('Location: admin.php');
exit;
}
how can i make that for 2 users?
help me please
I have on login script (if, else)
here is my script:
<?php
require_once 'config.php';
require_once 'functions.php';
$errMsg = '';
if (isset($_POST['txtUserid'])) {
// Check the user login. For now we only check it
// against a hardcoded value
if ($_POST['txtUserid'] == 'azservice' && $_POST['txtUserpw'] == 'azservice') {
$_SESSION['isLogin'] = true;
header('Location: admin.php');
exit;
}
else {
$errMsg = "Wrong Id/Password";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p> </p>
<?php
if ($errMsg != '') {
echo '<p align="center"><font color="#990000">' . $errMsg . '</font></p>';
}
?>
<form action="" method="post" name="frmCampaign" id="frmCampaign">
<table align="center" width="500" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>User Id</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserid" type="text" id="txtUserid" value=""></td>
</tr>
<tr>
<td width="200" bgcolor="#336699"><font color="#FFFFFF"><strong>Password</strong></font></td>
<td bgcolor="#FFFFFF"><input name="txtUserpw" type="password" id="txtUserpw" value=""></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
there is no problem now buy i need to make 2 users:
if (isset($_POST['txtUserid'])) {
if ($_POST['txtUserid'] == 'azservice' && $_POST['txtUserpw'] == 'azservice') {
$_SESSION['isLogin'] = true;
header('Location: admin.php');
exit;
}
how can i make that for 2 users?
help me please