0
在PHP中,是否可以使用將顯示兩個div元素之一的條件?我的僞代碼:在等待來自其他站點的值時顯示或隱藏div元素
//in Site 1
$tokenFromSite1 = 'xxx';
$tokenFromSite2 = '';
while($tokenFromSite1 != $tokenFromSite2){
//show div containing Connect button;
clickConnect(); //includes $tokenFromSite1 value as URL param "token" and opens a new tab to Site 2
//in Site 2
//gets $tokenFromSite1 value and opens a URL containing this value as param "token" and redirects to site 1
//back to Site 1
$tokenFromSite2 = //GET value of param "token"
}
//div containing Connect button disappears and shows a div that says "Connected"
我不知道如果我的邏輯是正確的,究竟是怎麼站點1將「等待」從站點2.還令牌值,我怎麼隱藏/顯示div元素?
你的問題超級不清。 – Enstage
你怎麼得到這個令牌?您可以使用ajax – GeekSilva
隱藏和顯示div /按鈕,而僅使用PHP是不可能的。您將需要使用javaScript/ajax來完成此操作。 – Pratikshya