Im starting to make a social network using all php, and I have a class that starts the session in the constructor, with session_start(); and tests if they are logged in. if at the end of that file I call the constructor... $session= new Session();... wouldn't that automatically start the session if I included that file in every page and thus carrying over variables?
WalkingSpheres.com if you wanna see the problem in action, the red error messages are
$errors = " ";
if(isset($_SESSION['error_array'])){
foreach($_SESSION['error_array'] as $error)
$errors .= "<font size='2' color='#ff0000'> $error </font><br />";
unset($error);
but it tests true EVERY TIME and if you havn't processed any forms yet how can that be true?
Secondly, this is a more structural question. Could anyone discusses the general layout of what classes I would need to make say a face book remake? - Thats broad, ill break it down.
IDEA:
Right now I have a session, database, and I was thinking if itd be smart to make a template class that the user is directed to after logging in which would get database's get methods to setup variables and then call the template which would just use the proper info.
MY HYPOTHESIS
Is this resonable? and if so how would create a "directory" for lack of better word so that when you sent the user to say template.class.php, if you should even send ties in with my lack of understanding about session variables, would you just add ?name='' to the url and get it on the template constructor?
Can I make it apply to any template? like directng them there with ?name=,
?photogallery=true, etc and build my request to the directory and then just direct all my hpyerlinks there?
Finally and lastly, would you create a folder named users in the root and then a folder with their name, a folder for pictures and notes on under that user and loop through a directory to make gallerys?
Thank you any direction would help im feeling overwhelmed and running out of time quickly.