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>

转载于:https://www.cnblogs.com/teyues/p/5775709.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值