注册,登陆网页设计源码

Login.html
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style type="text/css">
            body {background-image:url(/Php1/114d4f1fd9657b45f624e4fa.jpg);}
           
            {
                border-collapse: separate;
                border-spacing: 15px
            }
            table.two
            {
                border-collapse: separate;
                border-spacing: 10px 15px
            }
        </style>
    </head>
    <body >
        <form action="login.php" method="POST">
<a href="169.254.23.244:8080/Php1/register.html"target="_blank">注册</a>
<h1 align="center">登录页面</h1>
    <table class="one" border="4"align="center" >
        <tr>
          <td>username</td>
          <td><input type="text" value="" id="username"  name="username"/></td>
        </tr>
    </table>
        <br>
空调风管  <table class="two" border="4" align="center">
        <tr>
          <td>password</td>
          <td><input type="text" value="" id="password" name="password"/><td>
        </tr>
  </table>
    <br>
w3c
<table  align="center">
    <tr>
      <td><input type="submit" value="login" /></td>
    </tr>
</table>
      </form>
    </body>
</html>
Login.php
<?php
$connstr = "host=127.0.0.1 port=5432
        dbname=student user=postgres password=123456";
$conn = pg_connect($connstr);
if (!$conn) {
    echo "can't connect to database";
}
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "select count(1) from st_user where username=$1 and password=$2";
$params = array();
$params[0] = $username;
$params[1] = $password;
$result = pg_query_params($conn, $sql, $params);
//$sql = "select count(1) from st_user where username='$username' and password='$password'  ";
//$result = pg_query($conn, $sql);
//echo $sql . "<br>";
if (!$result) {
    echo pg_last_error($conn);
}
$row = pg_fetch_row($result);
if ($row[0] == 1) {
    echo "登录成功";
} else {
    echo "用户名不存在或密码有误请新用户注册以后再登录.";
}
pg_free_result($result);
pg_close($conn);
>
Register.html
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">有限元分析法
        <style type="text/css">
            body {background-image:url(/Php1/51e69373b8b8a33a8701b0fa.jpg);}
           
            {
                border-collapse: separate;
                border-spacing: 45px 10px
            }
            table.two
            {
                border-collapse: separate;
                border-spacing: 32px 10px
            }
我不是谁的偶像            table.three
            {
                border-collapse: separate;
                border-spacing:18px 10px
            }
            table.four
p4电源            {
                border-collapse: separate;
运动控制
                border-spacing: 10px 15px
            }
            p.thicker {font-weight: 900}
        </style>
    </head>
<body>
<a href="169.254.23.244:8080/Php1/login.html"target="_blank">返回登录首页</a>
    <h1 align="center">注册页面</h1>
  <form action="register.php" method="POST">
            <table class="one" align="center" border="4">
    <tr>
        <td><p class="thicker">username</p></td>
        <td>
<input type="text" value="" id="username"  name="username" />
        </td>
  </tr>
</table >
<br>
<table class="two" align="center" border="4">
  <tr>
        <td><p class="thicker">password</p></td>
        <td>
<input type="password" value="" id="password" name="password"/>
        <td>
  </tr>
</table>
  <br>
<table class="three" align="center" border="4">
  <tr>
  <td><p class="thicker">confirmpassword</p></td><td><input type="password" value="" id="confirmpassword" name="confirmpassword"/><td>

本文发布于:2024-09-24 08:29:39,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/715777.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:登录   密码   用户注册   页面
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议