error trying to create a session object

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nihilist65
Forum Newbie
Posts: 2
Joined: Fri Jan 23, 2004 3:38 am

error trying to create a session object

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Shoulsn't you be using $_SESSION and not $SESSION (notice the underscore)

Mark
nihilist65
Forum Newbie
Posts: 2
Joined: Fri Jan 23, 2004 3:38 am

Post by nihilist65 »

lol, god yes
thanks, thats what being up all night does to you : )
Post Reply