2 Replies - 457 Views - Last Post: 19 March 2009 - 02:38 PM Rate Topic: -----

#1 Alhazred  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 181
  • Joined: 25-July 07

Problem starting session

Posted 19 March 2009 - 08:07 AM

I'm trying to write an application and I need to have some variables available on several pages, so I've thought to put them into the session.
Well, I couldn't do that so I've tried a simple script like this
<?php
$started = session_start();

if($started)
   print "session started";
else
   print "session not started";
?>


the result is always "session not started".
I'm using a XAMPP platform, may that be caused because of register_globals set to off or because of any other reason?

Is This A Good Question/Topic? 0
  • +

Replies To: Problem starting session

#2 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Re: Problem starting session

Posted 19 March 2009 - 02:08 PM

Try like this to create session variable-
<?php
session_start();
$_SESSION['variable']='value';
?>
Was This Post Helpful? 0
  • +
  • -

#3 laces12  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 69
  • Joined: 20-November 08

Re: Problem starting session

Posted 19 March 2009 - 02:38 PM

Hmm... I dunno, it works for me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1