I just want to ask a pretty basic question...
1 - does
session_start();
HAVE to go to the very top as many people ive spoken with made it out to be?
I was also wanting to know if this would correctly be read by php, and is it even parsable
<?php
$Variable_Name = $_SESSION[$array['identifier']];
?>
or would I need to do this?
<?php
$_SESSION['Variable_Name'] = $array['identifier'];
$Variable_Name = $_SESSION['Variable_Name'];
?>
I am hoping for the first one.
The reason I am asking is because I have 15 site settings that get pulled on everypage to make sure everything it set correctly, or set to what the user wishes. However 15+ queries all the time is abit insuffiecent I believe, and would like to execute the sessions as best as possible. here is the code I plan to convert to sessions
<?php
$Settings = $MySQL->Fetch("SELECT * FROM ".$pre."settings");
$Site_Title = $Settings['site_title'];
$Site_Slogan = $Settings['site_slogan'];
$Site_Description = $Settings['site_description'];
$Site_Keywords = $Settings['site_keywords'];
$Admin_Email = $Settings['admin_email'];
$Site_Theme = $Settings['site_theme'];
$Site_Frontpage = $Settings['site_frontpage'];
$Site_Frontpage_Content = $Settings['site_frontpage_content'];
$Guest_Allowed = $Settings['guest_allowed'];
$Site_Lang = $Settings['site_lang'];
$Censor_Words = $Settings['censor_words'];
$Footer1 = $Settings['footer1'];
$Footer2 = $Settings['footer2'];
$PoweredBy = $Settings['poweredby'];
$Security_Login = $Settings['secure_login'];
$base_url = $Settings['base_url'];
$Emoticon_On = $Settings['emoticon_on'];
?>