-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·69 lines (52 loc) · 1.6 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LOGIN</title>
<?php
session_start();
include("connet.php");
$_SESSION['conf']=0;
?>
</head>
<body marginwidth="40%" marginheight="100px" >
<h1>Login</h1><br />
<form name="form1" method="post" action="">
<table width="200px" border="0">
<tr>
<th scope="row">Username:</th>
<td>
<input name="txtuser" type="text" id="txtuser"> </td>
</tr>
<tr>
<th scope="row">Password:</th>
<td>
<input name="txtpass" type="password" id="txtpass"> </td>
</tr>
<tr>
<th colspan="2" scope="row"><input name="s1" type="submit" id="s1" value="Sign In"><input name="s2" type="submit" id="s2" value="Sign Up">
<?php
if(isset($_POST['s1']))
{
$user=$_POST['txtuser'];
$pass=convert_uuencode($_POST['txtpass']);
$qry="select id from tbllogin where username='$user' and password='$pass'";
$result=mysql_query($qry);
if(mysql_num_rows($result)>0)
{ $_SESSION['usr']=$user;
$_SESSION['conf']=1;
header("location:home.php");}
else
echo "<br/>Wrong Combo<br/>Try Again";
}
else if(isset($_POST['s2']))
{
header("location:reg.php");
}
?>
</th>
</tr>
</table>
</form>
</body>
</html>