欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 header("Content-type:text/html;charset=utf-8"); ? form method="post" action="demo_setCookie2.php" name:input type="text" name="username" input type="submit" value="登录" /form ?php /
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
header("Content-type:text/html;charset=utf-8");
?>
/**
* demo_setCookie2.php
*/
if(isset($_POST["username"]) && $_POST["username"] == "benjamin"){
//正确,生成一个cookie 再跳转
setCookie("username","Benjamin");
header("Location:demo_setCookieSuccess.php");
}else{
header("Location:demo_setCookie.php");
}
?>
/**
* demo_setCookieSuccess.php
*/
header("Content-type:text/html;charset=utf-8");
if (isset($_COOKIE["username"])) {
echo "欢迎光临".$_COOKIE["username"];
}else{
echo "非法登录";
}
?>
[1] [2]

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

Dreamweaver Mac版
视觉化网页开发工具

记事本++7.3.1
好用且免费的代码编辑器

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

Dreamweaver CS6
视觉化网页开发工具