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  <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>
最新文章
- MongoDB初学
- iOS 最新版 CocoaPods 的安装流程
- ARM Linux 3.x的设备树(Device Tree)
- Chrome控制台输入多行js
- 工作中常用的QTP操作Excel函数
- 图像重采样(CPU和GPU)
- 如何让secureCRT显示Linux的颜色
- jqmobile
- Nginx 和 IIS 实现动静分离【转载】
- Angular2.js——表单(下)
- 6、Android Content Provider测试
- Mysql 的 create as 和create like 区别
- 【Apache Kafka】Kafka学习笔记
- Go语言中的struct tag
- 【转】nvidia-smi 命令解读
- ASP.Net MVC 中a标签的onclick时间和href同时存在时候的处理
- ";//./root/CIMV2"; because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected.
- android 获取系统默认路径
- Hive(二)CentOS7.5安装Hive2.3.3
- ansible的介绍和一些基本模块介绍