在特定脚本上无法识别PHP会话


PHP Session not being recognized on a particular script

userid SESSION被创建,但是在这个特定的脚本上,我得到"注意:未定义变量:_SESSION in C:'Workspace....process-request.php on line 6"错误。什么好主意吗?

<?php
if(isset($_GET['id'])) {
    echo $_GET['id'] . ": ";
}
if(isset($_GET['accepted'])) {
    $id = $_SESSION['userid'];
        mysql_connect("localhost", "root", "")or die("Could not connect: " . mysql_error());
        mysql_select_db("druvla_public") or die(mysql_error());
        mysql_query("INSERT IGNORE INTO requests (RequestSentByID, RequestRecipientID, StatusType, AddedMessage, FriendType)
            VALUES(1, '$id', 'Accepted', 'Welcome to Druvla', 'full')")or die(mysql_error());
    }
if(isset($_GET['denied'])) {
    echo "success";
}
?>

您忘了打电话给session_start()