选择显示字体大小

php4中session的应用(1)--登录页面(login.php3)


   <?php
//这个脚本是用来给用户输入口令,并判断口令是否正确的。
//如果正确则转到欢迎页面。
if (&#36;login){
    include(&quot;../include/config.inc.php3&quot;);
    session_start();
    &#36;right_enter=&#39;0&#39;;
    &#36;query=&quot;select * from user_define where user_login=&#39;&#36;user_login&#39; and user_pass=password(&#39;&#36;user_pass&#39;)&quot;;
    &#36;result=@mysql_query(&#36;query,&#36;dbconnect);
    if (&#36;user_array=@mysql_fetch_array(&#36;result)){
        &#36;user_id=&#36;user_array[user_id];
        &#36;user_name=&#36;user_array[user_info];
        session_register(&quot;user_id&quot;);
        session_register(&quot;user_name&quot;);
        session_register(&quot;user_array&quot;);
        if((&#36;user_array[ticket_day]) and (&#36;user_array[ticket_num])){
            &#36;right_enter=&#39;1&#39;;
        }
        else{
            &#36;error_message=&quot;对不起,您没有订票的权限!&quot;;
        }
    }
    else{
        &#36;error_message=&quot;错误!用户名错,或口令错。请重新输入。&quot;;
    }
    &#36;log_time=date(&quot;y-m-d h:i:s&quot;);
    &#36;query=&quot;insert into log_record (log_time,user_login,remote_addr,right_enter,enter_function) values (&#39;&#36;log_time&#39;,&#39;&#36;user_login&#39;,&#39;&#36;remote_addr&#39;,&#39;&#36;right_enter&#39;,&#39;1&#39;)&quot;;
    @mysql_query(&#36;query,&#36;dbconnect);
    if(&#36;right_enter){
        header(&quot;location: welcome_reserve.php3&quot;);
        exit;
    }
}
if(&#36;logout){
    session_start();
    session_unregister(&quot;user_id&quot;);
    session_unregister(&quot;user_name&quot;);
    session_unregister(&quot;user_array&quot;);
}
?>
<!doctype html public &quot;-//w3c//dtd html 4.0 transitional//en&quot;>

<html>
<head>
    <title>用户登录</title>
<meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=gb2312&quot;>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../include/njz_common.css&quot;>
</head><body>
<p> </p>

<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;<?php echo &#36;php_self; ?>&quot; >
  <table width=&quot;289&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; bordercolor=&quot;#999999&quot; align=&quot;center&quot;>
    <tr bgcolor=&quot;#999999&quot;>
      <td>
        <div align=&quot;center&quot;><font color=&quot;#ffffff&quot; size=&quot;4&quot;>用户登录</font></div>
      </td>
    </tr>
    <tr>
      <td>
        <table width=&quot;267&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; align=&quot;center&quot;>
          <tr>
            <td width=&quot;94&quot;>
              <div align=&quot;right&quot;>用户:</div>
            </td>
            <td width=&quot;169&quot;>
              <input type=&quot;text&quot; name=&quot;user_login&quot; size=&quot;16&quot; maxlength=&quot;16&quot; value=&quot;<?php echo &#36;user_login; ?>&quot;>
            </td>
          </tr>
          <tr>
            <td width=&quot;94&quot;>
              <div align=&quot;right&quot;>口令:</div>
            </td>
            <td width=&quot;169&quot;>
              <input type=&quot;password&quot; name=&quot;user_pass&quot; size=&quot;16&quot; maxlength=&quot;16&quot;>
            </td>
          </tr>
          <tr>
            <td colspan=&quot;2&quot;>
              <div align=&quot;center&quot;>
                <input type=&quot;submit&quot; name=&quot;login&quot; value=&quot; 登  录 &quot;>
                <input type=&quot;button&quot; name=&quot;return_index&quot; value=&quot;返回首页&quot; onclick=&quot;form1.action=&#39;../include/goto_page.php3?dist_page=../main.php3&#39;;form1.submit();return;&quot;>
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<?php
if(&#36;error_message) echo &quot;<center><font color=&#39;#ff0000&#39;>&#36;error_message</font></center>&quot;;
?>
<script language=&quot;javascript&quot;>document.form1.user_login.focus();
</script>
<p> </p>
<?php include(&quot;../footer.php3&quot;); ?>
</body>
</html>
 


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons