ОБСУЖДЕНИЕ

Помогите поправить не пойму чего не работает

5 сообщений1 просмотровЗакрыта
#1
PHP
<?php
require('core/connect.php');
$title = 'Выход';
require('core/head.php');
if(!$user){header('Location: /index.php');exit;}

$ok = htmlentities($_GET['ok']);
switch($exit){
default:
echo '<form method="post" action="?">
Вы уже хотите покинуть наш портал. Уверенны в своём решении?<br/>
<input type="submit" name="yes" value="Да, я хочу выйти" />
<input type="submit" name="no" value="Нет, я хочу остаться" />
 </form>';
break;
case 'ok':
if(isset($_POST['yes'])){
$_SESSION['pass']=false;
$_SESSION['login'] = false;
setcookie('login', '');
setcookie('pass', '');
header("Location: /");
}else{
header("Location: /");
}
break;
}
require('core/foot.php');
?>
#2
if ( isset( $ _ POST [ 'yes '])) {
#3
<?php
require('core/connect.php');
$title = 'Выход';
require('core/head.php');
if(!$user){header('Location: /index.php');exit;}

$exit= htmlentities($_GET['ok']);
switch($exit){
default:
echo '<form method="post" action="?ok">
Вы уже хотите покинуть наш портал. Уверенны в своём решении?<br/>
<input type="submit" name="yes" value="Да, я хочу выйти" />
<input type="submit" name="no" value="Нет, я хочу остаться" />
</form>';
break;
case 'ok':
if(isset($_POST['yes'])){
$_SESSION['pass']=false;
$_SESSION['login'] = false;
setcookie('login', '');
setcookie('pass', '');
header("Location: /");
}else{
header("Location: /");
}
break;
}
require('core/foot.php');
?>
Пользуйтесь;)
#4
mir007, Спасибо
#5
Тему закрыл SyncMaster!
Причина: Решена проблема