Two Sessions Questions
I am developing a members site, and trying to make it template and DB driven, so it can be transportable between domains.
Each page that is called makes use of include statements to bring in the constant information that is found on every page
Sample page call
<?php
include '../all_inc/pghead.php';
//(starts session / connects to DB / includes functions / Queries DB for site details, email, url, etc. then gets member information from DB / checks to see if ‘Logged In’ / sets up html and <head)
include '../all_inc/pgtop.php';
//(Does the basic html stuff. : closes head tag / body / sets up primary table / displays header graphic / leaves open <tr and <td for the body of the page to be displayed)
include '../all_inc/body_table_top.php';
//(Simply opens the body <table and displays left navigation menu, and leaves <tr <td open for the main body file to be included into for display)
include 'body_verifyemail.php';
//(Does whatever that page is supposed to do)
include '../all_inc/body_table_bottom.php';
//(Nothing more then </td> </tr> </table> left open in table top)
include '../all_inc/pgbottom.php';
//(Closes td and tr left open in the pgtop.php / displays the footer, etc / closes table left open in pgtop / closes body and html opened in pghead and pgtop)
?>
That is it in a nutshell, and it makes every page look identical.
Now the questions:
FIRST :
When you assign a value to a session variable
$_SESSION = $_POST[‘user’];
From that point on, to access that value:
do you have to use $_SESSION or is it just $user
SECOND:
Would it be better to assign session variables to all the data that is gathered in the pghead from the DB queries, and not have to do the queries each time a page is loaded, or is it better to do the queries?
Actually THIRD:
Does this look like a good approach to site building?
If a live URL would help, I can provide that, but it isn't a 'live' site, just a test and development site.
I have gotten good information/advice here, so I trust your feedback.
Thanks in advance
Doug