session_start()

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
Gerard_P
Forum Newbie
Posts: 6
Joined: Thu May 01, 2003 6:44 am

session_start()

Post by Gerard_P »

Is it necessary to write session_start( ) in all the files that need session?

Thanks in advance.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Most scripts are build with 1 page.

That includes ohter pages....

Code: Select all

<?
  session_start();

  $act = (isset($_GET["act"])) ? $_GET["act"]: "index";

  if(file_exists($act.".inc.php")){
    include($act.".inc.php");
  }
?>
Gerard_P
Forum Newbie
Posts: 6
Joined: Thu May 01, 2003 6:44 am

Post by Gerard_P »

Thanks for the tip.
Post Reply