php session problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kong Chun Ho
    New Member
    • Jul 2010
    • 34

    php session problem

    Hi all,

    I have a php session problem when i echo a session_id, it return nothing!

    Code:
    <?php if(!session_start()) { exit(); }else{ ob_start(); session_start(); echo session_id(); echo SID; ob_end_clean(); }?>
    // html code...
    nothing returned!

    thanks!
  • zorgi
    Recognized Expert Contributor
    • Mar 2008
    • 431

    #2
    If you want to use output buffering have a look at:

    ob_get_contents

    If not than simply comment out //ob_start() AND //ob_end_clean()

    Comment

    • Kong Chun Ho
      New Member
      • Jul 2010
      • 34

      #3
      Thanks for reply, i have removed ob_start() and ob_end_clean(), and it can print out now!

      But now, i have another problem, i will open another post.

      Thanks!

      Comment

      Working...