<? Php
// This script is used to enter a password for the user and determine whether the password is correct.
// If it is correct, go to the welcome page.
If ($ login ){
Include ("../include/config. inc. php3 ");
Session_start ();
$ Right_enter = '0 ';
$ Query = "select * from user_define where user_login = '$ user_login' and user_pass = password ('$ user_pass ')";
$ Result = @ mysql_query ($ query, $ dbconnect );
If ($ user_array = @ mysql_fetch_array ($ result )){
$ User_id = $ user_array [user_id];
$ User_name = $ user_array [user_info];
Session_register ("user_id ");
Session_register ("user_name ");
Session_register ("user_array ");
If ($ user_array [ticket_day]) and ($ user_array [ticket_num]) {
$ Right_enter = '1 ';
}
Else {
$ Error_message = "sorry, you do not have permission to book tickets! ";
}
}
Else {
$ Error_message = "error! The user name or password is incorrect. Enter again. ";
}
$ Log_time = date ("Y-m-d H: I: s ");
$ Query = "insert into log_record (log_time, user_login, remote_addr, right_enter, enter_function) values ('$ log_time', '$ user_login', '$ region',' $ right_enter ', '1 ')";
@ Mysql_query ($ query, $ dbconnect );
If ($ right_enter ){
Header ("Location: welcome_reserve.php3 ");
Exit;
}
}
If ($ logout ){
Session_start ();
Session_unregister ("user_id ");
Session_unregister ("user_name ");
Session_unregister ("user_array ");
}
?>
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<Html>
<Head>
<Title> User Logon </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" type = "text/css" href = "../include/njz_common.css">
</Head> <body>
<P> </p>
<Form name = "form1" method = "post" action = "<? Php echo $ PHP_SELF;?> ">
<Table width = "289" border = "1" cellspacing = "0" cellpadding = "1" bordercolor = "#999999" align = "center">
<Tr bgcolor = "#999999" type = "codeph" text = "/codeph">
<Td>
<Div align = "center"> <font color = "# FFFFFF" size = "4"> User Logon </font> </div>
</Td>
</Tr>
<Tr>
<Td>
<Table width = "267" border = "0" cellspacing = "0" cellpadding = "5" align = "center">
<Tr>
<Td width = "94">
<Div align = "right"> User: </div>
</Td>
& Lt; td width = "169" & gt;
<Input type = "text" name = "user_login" size = "16" maxlength = "16" value = "<? Php echo $ user_login;?> ">
</Td>
</Tr>
<Tr>
<Td width = "94">
<Div align = "right"> password: </div>
</Td>
& Lt; td width = "169" & gt;
<Input type = "password" name = "user_pass" size = "16" maxlength = "16">
</Td>
</Tr>
<Tr>
<Td colspan = "2">
<Div align = "center">
<Input type = "submit" name = "login" value = "login">
<Input type = "button" name = "return_index" value = "back to homepage" onClick = "form1.action = '../include/goto_page.php3? Dist_page =.../main. php3 '; form1.submit (); return; ">
</Div>
</Td>
</Tr>
</Table>
</Td>
</Tr>
</Table>
</Form>
<? Php
If ($ error_message) echo "<center> <font color = '# ff0000'> $ error_message </font> </center> ";
?>
<SCRIPT language = "JavaScript"> document. form1.user _ login. focus ();
</SCRIPT>
<P> </p>
<? Php include ("../footer. php3");?>
</Body>
</Html>