创建了userid SESSION,但是在这个特定的脚本上,我得到了“注意:未定义的变量:C:\ Workspace中的_SESSION ......第6行的process-request.php”错误。有什么想法吗?
<?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";
}
?>