Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'session start and include'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hello all, On my website I use a "body template" to hold contents of various pages, and the body template files will call for a "header template" to display the header contents of the site, like in the following two template files: Note: the "body.php" file runs first. HEADER TEMPLATE FILE 'HEADER.php': ================================ <?php session_start(); //POSITION "A" if (...) { ... } else { ... } ?> <!doctype html> etc etc </head> <body> <!-- END HEADER TEMPLATE FILE --> BODY TEMPLATE FILE 'body.php': ================================ <?php session_start(); //POSITION "B" if (...) { ... } else { ... } include('HEADER.php'); ?> <!-- BEGIN BODY CONTENTS --> Body contents etc etc <!-- END BODY CONTENTS --> <?php include('FOOTER.php'); ?> <!-- END BODY TEMPLATE FILE --> And as you can see, I also use session on the site as well. I learned that session_start() must be placed in the beginning of a file, so currently I have session_start() in both the body.php and HEADER.php files (see positions "A" and "B" in the templates above). Currently the pages are displaying fine but somehow I think I might have missed something. Could someone please let me know if the above use is correct? Or, should I use only one session_start() in one of the two templates? And, which one should I keep (position "A" or "B")? Thanks in advance! Cofa
×
×
  • Create New...