-
Notifications
You must be signed in to change notification settings - Fork 9
/
index1.php
40 lines (40 loc) · 1.09 KB
/
index1.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
<?php
############################################
# ThaiRIS (Thai Radiology Information System)
# Version: 1.0
# File last modified: 8 Nov 2016
# File name:
# Description :
# http://www.thairis.net
# Email : [email protected]
############################################
session_start();
$sessionID = session_id();
$username = $_POST['user'];
$username = trim($username);
$userpassword = $_POST['password'];
include ("connectdb.php");
$sql = "select LOGIN, PASSWORD FROM xray_user WHERE LOGIN='$username'and PASSWORD='$userpassword'";
$result = mysql_query($sql);
$numrows = (mysql_num_rows($result));
if($numrows == 1)
{
$updatelogin = '';
mysql_query("update xray_user SET SESSION ='$updatelogin' WHERE SESSION ='$sessionID'");
mysql_query("update xray_user SET SESSION ='$sessionID'");
//¶éÒ¶Ù¡µéͧ
$_SESSION['logged_in'] = 1;
$_SESSION['USER'] = $username;
//echo $username;
//echo "<br>".$userpassword;
header("Location: index2.html");
exit;
}
if ($numrows == 0)
{
//¶éÒäÁè¶Ù¡µéͧãËé¡ÅѺä»Ë¹éÒáá
//echo "xxxxx";
header("Location: login.html");
exit;
}
?>