How can I prevent users from browsing to any page they want to on my website by typing in the URL to it in the address bar? I only want them to be able to access the main page (index.php) ?
@Brad_ArmitageauthorOct 14.2005 — #Actually an authentification script is exactly what I'm looking for but I'm havin trouble with one right now, can you give me an example?
/** * Create a User (add post info to tables) * * @param array $post * @return boolean */ function create($post) { global $db; $sql = "INSERT INTO $db[users] VALUES('', '$post[username]', '$post[email]', '$post[password]', '$post[group]', '$post[level]' ) ";
if(runSQL($sql)) { return true; }
else { return false; } }
/** * Update via REPLACE query a user * * @param array $post * @return boolean */ function update($post) { global $db; $sql = "REPLACE INTO $db[users] VALUES('', '$post[username]', '$post[email]', '$post[password]', '$post[group]', '$post[level]' )
WHERE username = '$post[username] ";
if(runSQL($sql)) { return true; }
else { return false; } }
/** * Delete user record * * @param array $post * @return boolean */ function delete($post) { global $db; $sql = "DELETE * FROM $db[users] WHERE username = $post[username]";