3 回答
TA贡献1784条经验 获得超9个赞
存储在会话中的值必须在脚本执行结束时被丢弃。
销毁
$_SESSION
使用unset($ _ SESSION)
和然后使用销毁会话本身
session_destroy();
TA贡献1777条经验 获得超10个赞
一旦 if 语句完成,我就可以通过使用窗口弹出窗口来清除变量。
if ($Num_CTeams > 1 && $_SESSION["Pickleball"] !="") {
echo '<script language="javascript">';
echo 'alert("Sorry, Captains can only captain up to two teams ONLY.")';
echo '</script>';
$_SESSION["formatPickleball"] = "";
}
TA贡献1827条经验 获得超9个赞
<?php
session_start();
echo $_SESSION["formatPickleball"];
$_SESSION["Pickleball"] = "";
if (isset($_POST['format1']) && $_POST['format1'] && isset($_POST['member']) && $_POST['member']) {
$_SESSION["formatPickleball"] = $_POST['member'];
$_SESSION["Pickleball"] = "hide";
}
if ($_SESSION["formatPickleball"] == "Captain") {
$regCAP = isset($_POST['submitCAP']) && $_POST['submitCAP'] ? "show": "";
$secondCAP = isset($_POST['submit2']) && $_POST['submit2'] ? "show": "";
$thirdCAP = isset($_POST['submit3']) && $_POST['submit3'] ? "show": "";
}
if ($_SESSION["formatPickleball"] == "Player") {
$regPlay = isset($_POST['submitPlay']) && $_POST['submitPlay'] ? "show" : "";
}
- 3 回答
- 0 关注
- 106 浏览
添加回答
举报