首页 > 编程 > PHP > 正文

php模拟数据库常用操作效果

2019-11-14 14:47:57
字体:
来源:转载
供稿:网友

test.php

<?phpheader("Content-type:text/html;charset='utf8'");error_reporting(E_ALL);echo "模拟数据库常用操作效果<br>";echo "<a href='check.php?action=add'>执行增加操作</a><br>";echo "<a href='check.php?action=del'>执行删除操作</a><br>";echo "<a href='check.php?action=search'>执行查找操作</a><br>";echo "<a href='check.php?action=update'>执行更新操作</a><br>";

check.php

<?php    if(isset($_GET['action'])){        switch($_GET['action']){            case "add":                echo "<script>alert('add');</script>";                break;            case "del":                echo "<script>alert('del');</script>";                break;            case "search":                echo "<script>alert('search');</script>";                break;            case "update";                echo "<script>alert('update');</script>";                break;            default:                echo "<script>alert('error');</script>";                break;        }        // echo "<script>window.location = 'test.php';</script>";        echo "<script>history.go(-1);</script>";    }


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表