userid SESSION is created, but on this particular script, I get “Notice: Undefined variable: _SESSION in C:\Workspace….process-request.php on line 6” errors. Any ideas?
<?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";
}
?>
You forgot to call
session_start()