Page 1 of 1

error trying to create a session object

Posted: Fri Jan 23, 2004 3:38 am
by nihilist65
$SESSION["vpcamus"] isnt being recongnized as an object, im just its an error i just cant see(especially since its 4:30 am), can anybody help?

<?php
session_start();
include("vp.class.php");
if(!isset($SESSION["vpcamus"])){
$SESSION["vpcamus"] = new vp; }
echo isset($SESSION["vpcamus"]);
?>
....
this page submits a form
to this page-->


<?php session_start();
include("vp.class.php");
if(!isset($SESSION["vpcamus"])){ //this isnt set when it gets here
header("Location: http://".$_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) ."/vp.php");
exit; }
}
$SESSION["vpcamus"]->input($_POST["enttext"]); //the error says this is a non-object
?>

the class...
<?php
class vp {
var $convo;
var $reply;
var $input;
var $matches;
var $strips;
function vp(){.....

thanks, katie

Posted: Fri Jan 23, 2004 3:55 am
by JayBird
Shoulsn't you be using $_SESSION and not $SESSION (notice the underscore)

Mark

Posted: Fri Jan 23, 2004 6:05 am
by nihilist65
lol, god yes
thanks, thats what being up all night does to you : )