首頁 > php教程 > php手册 > php模拟数据库常用操作效果,php模拟数据库

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

WBOY
發布: 2016-06-13 08:55:08
原創
858 人瀏覽過

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

test.php

<?<span>php
</span><span>header</span>("Content-type:text/html;charset='utf8'"<span>);
</span><span>error_reporting</span>(<span>E_ALL</span><span>);

</span><span>echo</span> "模拟数据库常用操作效果<br>"<span>;
</span><span>echo</span> "<a href='check.php?action=add'>执行增加操作</a><br>"<span>;
</span><span>echo</span> "<a href='check.php?action=del'>执行删除操作</a><br>"<span>;
</span><span>echo</span> "<a href='check.php?action=search'>执行查找操作</a><br>"<span>;
</span><span>echo</span> "<a href='check.php?action=update'>执行更新操作</a><br>";
登入後複製

check.php

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

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門推薦
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板