PHP oturumlar ile çalışma

0 Cevap

Ben sadece bir kullanıcı giriş sistemi gelişmiş ve farklı kullanıcılar için farklı oturumları oluşturmak istiyorum.

Bir oturum başlatır ve girilen kullanıcı adı "bir" ise, farklı bir sayfaya yönlendirir ve adı "b" ise, farklı bir sayfaya yönlendirir, böylece PHP nasıl bir kod yazmak yok.

Update:

Bu kullanmış

session_start();

switch ($_SESSION['username']) {
    case 'a':
        // $_SESSION['username'] is 'a'
        // redirect to file1.php
        header('Location: file1.php');
        die();
        break;
    case 'b':
        // $_SESSION['username'] is 'b'
        // redirect to file2.php
        header('Location: file2.php');
        die();
        break;
    default:
        // $_SESSION['username'] is neither a, nor b, or is not set at all
        // redirect to default.php
        header('Location: default.php');
        die();
        break;
}

ama ne olursa olsun ben girmek ne adınızı, o dosya1.php beni götürüyor

0 Cevap