So in my effort to create a better site, I decided to use classes rather than just including the header and the footer... Which means I can add to the site as I go... I won't bother anyone that doesn't want to help me out, so read more:
< ?php
class Page
{
function DisplayHeader()
{
? >
... this is the html for the header of my page ...
< ?php
}
function DisplayFooter()
{
? >
... the html for the footer ...
< ?php
}
}
? >
And then, we would call it with something like:
< ?php
require ('class.inc');
$homepage = new Page();
$homepage -> DisplayHeader();
? >
table, td, content content content
< ?php
$homepage -> DisplayFooter();
? >
The next part is a wee bit harder...
See, I've read about a dozen articles on sessions... Throughout the site I want to be able to use something like < ?= $user_name ? > to be able to call defined information... I want to log the sessions in the database (I have already set up the database table)...
Upon registering users, I was able to md5 AND salt their passwords... (salt being adding about five random characters)... so we'd have a login script that would UPDATE the users table for their last login, and INSERT into the session table... It also needs to remember the username, password and email addy throughout the site... so that I can global functions based on the user... and then we could use something like an LoggedIn() function to be able to change the nav from logged in to not...
Can I get a crash course on how to do this???
-Shade
< ?php
class Page
{
function DisplayHeader()
{
? >
... this is the html for the header of my page ...
< ?php
}
function DisplayFooter()
{
? >
... the html for the footer ...
< ?php
}
}
? >
And then, we would call it with something like:
< ?php
require ('class.inc');
$homepage = new Page();
$homepage -> DisplayHeader();
? >
table, td, content content content
< ?php
$homepage -> DisplayFooter();
? >
The next part is a wee bit harder...
See, I've read about a dozen articles on sessions... Throughout the site I want to be able to use something like < ?= $user_name ? > to be able to call defined information... I want to log the sessions in the database (I have already set up the database table)...
Upon registering users, I was able to md5 AND salt their passwords... (salt being adding about five random characters)... so we'd have a login script that would UPDATE the users table for their last login, and INSERT into the session table... It also needs to remember the username, password and email addy throughout the site... so that I can global functions based on the user... and then we could use something like an LoggedIn() function to be able to change the nav from logged in to not...
Can I get a crash course on how to do this???
-Shade
