-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.php
38 lines (34 loc) · 902 Bytes
/
log.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
<?php
session_start();
if(isset($_POST['submit']))
{
mysql_connect("localhost","cybermart","calm") or die(mysql_error());
mysql_select_db('php') or die(mysql_error());
$name=$_POST['txtuname'];
$pwd=$_POST['txtpassword'];
if($name!='' && $pwd!='')
{
$query=mysql_query("select *from register where username='".$name."' and password='".$pwd."'") or die(mysql_error());
$res=mysql_fetch_row($query);
if($res)
{
$_SESSION['txtuname']=$name;
header('location:display.php');
}
else
{
echo'<script language="javascript">' ;
echo'alert("Invalid user Name or password")';
echo'</script>';
}
}
else
{
/* echo'Enter both username and password; */
echo'<script language="javascript">';
echo'alert("Enter both username and password")';
echo'</script>';
exit;
}
}
?>