Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    session var PRINT IN A PHP PAGE that is included in an email ?

    session_start() must included in a page in which, it get prints a session var ? If yes only at START OF PAGE or to the place exactly the session var get echoed ?

    When a php page included in an email message:

    Code:
    ob_start(); 
    include('b-to-customer.php');  //include('book-confirm-to-customer.php'); 
    $message_customer = ob_get_clean();
    then session vars print on the email on not ? I do NOT see to get print (in the email) ...

    Code:
    <?php session_start();  
    echo $_SESSION['m'];
    unset($_SESSION['m']);  ?>

  • #2
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    session_start() should be called at the top of the page. Then, you can echo or set session variables on the rest of the page whenever you need.

    http://us3.php.net/session_start


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •