Re: can someone please explain this code
Posted by:
drivingmenuts
(---.austin.res.rr.com)
Date: June 21, 2006 12:41AM
There are two parts
1. The script calls the authenticated_user function, which does its thing and returns a true if the user is allowed to access or false if not. If the user is allowed access, then it sets the variable authenticated to the value true.
2. Then, it check to see if the variable authenticated is true. If it is, it includes a file, which presumably does things that an unauthenticated user would not be allowed to see.
The code can be shortened:
<?php
if (authenticated_user()) {
$authorized=true;
include "whateverfileyouwerelookingfor.php";
}
?>
It saves a wee bit of time.