0
對於使用此代碼這一刻:
if ($_GET['page'] == 'index'
and file_exists('./intl/tpl/' . $_GET['page'] . '.tpl')
or !file_exists('./intl/tpl/' . $_GET['page'] . '.tpl')
or !$_GET['page']) {
//code
} elseif ($_GET['page'] == 'multi'
and file_exists('./intl/tpl/' . $_GET['page'] . '.tpl')) {
//code 2
}
等等...
問題1:此代碼是否 「好」?不需要任何轉義或什麼?
問題2:頁=註銷好好嘗試的工作,所以我創建logout.php它看起來像:
<?php
require_once "./intl/config.php";
SessionDelete('logged_in');
SessionDelete('username');
SessionDelete('userid');
if ($user_admin != null) {
SessionDelete('inadmin');
if (SessionGet('s_order') != null or SessionGet('s_page_show_all') != null) {
SessionDelete('s_order');
SessionDelete('s_page_show_all');
}
}
header('Location: '.$config['indexurl'].'index.php');
?>
也許之前的會議中刪除不需要的會話啓動並有可能做到這一點與網頁=註銷? ?
使用'&&'而不是'和'和'||'而不是'或' – pltvs
我會爲此創建2個問題。有很多要討論你的第一個問題......從我可以看到你的代碼是次優的 – smcphill
即時通訊這相當於使用更強硬的'和''或' – dynamic