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

WBOY
Libérer: 2016-07-29 09:16:19
original
1208 Les gens l'ont consulté

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>";
Copier après la connexion

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>
Copier après la connexion

以上就介绍了php模拟数据库常用操作效果,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal