第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在我取消設(shè)置變量之前,我的多表單頁面工作得很好。為什么?

在我取消設(shè)置變量之前,我的多表單頁面工作得很好。為什么?

慕勒3428872 2023-09-11 16:49:38
我已經(jīng)在多表單頁面上工作了一段時(shí)間。我需要一些幫助來嘗試?yán)斫鉃槭裁串?dāng)我取消設(shè)置變量時(shí),多表單頁面無法正常工作。我在代碼中放置了一條 echo 語句來跟蹤變量值,甚至在頁面刷新后變量仍然保留。從字面上看,我必須刪除該站點(diǎn)的 cookie 才能取消設(shè)置該變量。這是代碼:<?phpsession_start();// Start the sessionecho $_SESSION["formatPickleball"];$_SESSION["Pickleball"] = "";// Submit button is pressedif (isset($_POST['format1'])){    $_SESSION["formatPickleball"] = $_POST['member'];    $_SESSION["Pickleball"] = "hide";}if ($_SESSION["formatPickleball"] == "Captain") {$regCAP = "";// Submit button is pressedif (isset($_POST['submitCAP'])){$regCAP = "show";}$secondCAP = "";// Submit button is pressedif (isset($_POST['submit2'])){$secondCAP = "show";}$thirdCAP = "";// Submit button is pressedif (isset($_POST['submit3'])){$thirdCAP = "show";}} elseif ($_SESSION["formatPickleball"] == "Player") {$regPlay = "";// Submit button is pressedif (isset($_POST['submitPlay'])){$regPlay = "show";} }?><html><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"><script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css">    <script type="text/javascript"></script><body><div id="mainForm">    <h4>Are you a Captain or a Player on a Team?</h4><form method='POST'>    <input type="radio" name="member" value="Captain">Captain    <input type="radio" name="member" value="Player">Player<br>    <input type="submit" name="format1" value="Select">     </form></div>當(dāng)我添加 $_SESSION["formatPickleball"] = ""; 到php代碼的頂部,多表單無法正常工作。我有兩個(gè)問題 1) 如何在不刪除 cookie 的情況下取消設(shè)置變量?2)這是用 PHP 編寫此代碼的最有效方法嗎?
查看完整描述

3 回答

?
千萬里不及你

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超9個(gè)贊

存儲(chǔ)在會(huì)話中的值必須在腳本執(zhí)行結(jié)束時(shí)被丟棄。

  1. 銷毀 $_SESSION 使用 unset($ _ SESSION) 和

  2. 然后使用銷毀會(huì)話本身 session_destroy();


查看完整回答
反對(duì) 回復(fù) 2023-09-11
?
不負(fù)相思意

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"] = "";


查看完整回答
反對(duì) 回復(fù) 2023-09-11
?
素胚勾勒不出你

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" : "";

}


查看完整回答
反對(duì) 回復(fù) 2023-09-11
  • 3 回答
  • 0 關(guān)注
  • 169 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)