Neaten Up PHP User Systems
Alright. ive deciced that im sick of $logged[this.] everywere. so ive done some coding, and made a few files.
[that you will need to add to] to make your life alot easier.
So right now we are going to make a file that changes $logged[username] into $name. there will only be one file that will contain a large list
Call This File simplify.php
<?php
include_once("connect.php"); // this isnt needed. but you may feel free to remove it.
$name = $logged[username] //instead of typing $logged[username] you may now time $name
$email = $logged[email] //instead of $logged[email] its $email
$location = $logged[location] //i think you get it now
$userlevel = $logged[userlevel]//you can add code witch i will explain in part 2. that can make it say Different things.
$age = $logged[age]
$sex = $logged[sex]
?>
You can do heaps with this. run sql querys by adding
$query = MYSQL_QUERY("SELECT * FROM `members` WHERE `id` = '$_SESSION[id]' AND `password` = '$_SESSION[password]'");
It makes it alot easier for when you want to change and update things.
Finally. inculde this into the pages you want to make the changes into
<?php
include("simplify.php");
?>
Any Questions Ask Me :)