zoukankan      html  css  js  c++  java
  • php简单框架的应用实例

    <html>

    <frameset rows="50%,50%">

    <frame src="/Test/header.php">

    <frameset cols="25%,75%">
    <frame src="/Test/collect.php">
    <frame src="/Test/view.php">
    </frameset>

    </frameset>

    </html>


    header.php
    <html>
    <head>
    </head>
    <body>
    <h1>
    管理员登录界面</h1>
    </body>
    </html>

    collect.php
    <html>
    <head>
    </head>
    <body>
    员工号:<input type="text"></input>
    <button type="button"value="查询">查询</button>
    </body>
    </html>

    view.php
    <html>
    <head>
    </head>
    <body>
    <p>This is the View.
    </body>
    </html>

    POST GET test

    <html>

    <body>

    <?php

    <form action="success.php" method="post">

      Name:<input type="text" name="name"><br>

      pwd:<input type="password" name="pwd"><br>

    <input type="submit">

    </form>

    ?>

    </body>

    </html>

    success.php

    <html>

    <body>

    <?php

    welcome<?php echo $_POST["name"];?>

    ?>

    </body>

    </html>

    form_check

    <!DOCTYPE html>

    <html>

    <head>

    <style>

    .class{#ff000};

    </style>

    </head>

    <body>

    <h2>PHP  form check</h2></br>

    <span class="error">necessary message</span></br> 

    <form action="check.php" method="post">

    Name:<input type="text" name="name"><span class="error"><?php echo $nameErr;?></span></br>

    Email:<input type="text" name="email"><span class="error"><?php echo $emailErr;?></span></br>

    Web:<input type="text" name="web"></br>

    Comment:<input type="textarea" name="comment"></br>

    Gender:<input type="radio" name="gender">male &nbsp<input type="radio" name="gender">female <?php echo $genderErr;?></br>

    <input type="submit">

    </form>

    </body>

    </html>

    check.php

    <!DOCTYPE html>

    <html>

    <head>

    </head>

    <body>

    <?php

        $nameErr=$emailErr=$genderErr=$webErr="";

        $name=$email=$gender=$web="";

         if($_SERVER["REQUEST_METHOD"]=="POST"){

          if(empty($_POST["name"])){

          $nameErr="Name is necessary";

            }else{

            $name=test_input($_POST["name"]);}

          if(empty($_POST["email"])){

          $emailErr="email is necessary";

            }else{

            $email=test_input($_POST["email"]);}

         

         if(empty($_POST["web"])){

          $webErr="email is necessary";

            }else{

            $web=test_input($_POST["web"]);}

         

         if(empty($_POST["gender"])){

          $genderErr="email is necessary";

            }else{

            $gender=test_input($_POST["gender"]);}

    }

    ?>

    <?php

    echo"<h1> Your input is:</h1>"</br>

    echo $name;

    echo "<br>";

    echo $email;

    echo "<br>";

    echo $web;

    echo "<br>";

    echo $comment;

    echo "<br>";

    echo $gender;

    echo "<br>";

    ?>

    </body>

    </html>

  • 相关阅读:
    回顾
    单例模式
    元类
    反射和内置方法
    issubclass 和 isinstance和断点调试
    绑定方法和非绑定方法
    并发编程:IO多路复用。
    基于tcp的下载文件,以及struct模块的应用。
    并发编程:协程,异步调用。
    并发编程:GIL,线程池,进程池,阻塞,非阻塞,同步,异步
  • 原文地址:https://www.cnblogs.com/teyues/p/5775709.html
Copyright © 2011-2022 走看看