3 回答

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超9個(gè)贊
存儲(chǔ)在會(huì)話中的值必須在腳本執(zhí)行結(jié)束時(shí)被丟棄。
銷毀
$_SESSION
使用unset($ _ SESSION)
和然后使用銷毀會(huì)話本身
session_destroy();

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超10個(gè)贊
一旦 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貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超9個(gè)贊
<?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 關(guān)注
- 169 瀏覽
添加回答
舉報(bào)