View Full Version : Manual Links?
masterofollies
01-01-2009, 06:51 PM
Is there anything that can prevent people from manually typing in links to access areas they aren't suppose to?
Such as www.mywebsite.com/admin/admin.php?do=edit
Something that would cut them off and say you cannot manual type in a link?
oracleguy
01-01-2009, 08:58 PM
Yes, you would need to write some PHP code to protect pages so that before the page loads it checks if the user doesn't have permission to view the page. If they don't, you can have them redirected or display an error message.
mlseim
01-01-2009, 09:34 PM
That's what PHP SESSIONS are for.
They need to be logged-in to access certain pages,
or you set your own SESSION just for yourself, so you
can access them, but nobody else can.
If your site is not that important (where security is really an issue),
you could just use Cookies instead of SESSION. You could set a
cookie on your PC that won't ever expire. Each protected page checks
for the cookie before it displays the page.
masterofollies
01-01-2009, 10:48 PM
Ok thanks,
Yeah I use sessions and can block them if they aren't an Admin. But I thought there might somehow be a general code, program, or script for this type of thing.
....Maybe one day!
mlseim
01-02-2009, 03:32 AM
It's no big deal really ...
You have a script (like a login script that starts a SESSION),
say you use this:
$_SESSION['mof'] = 'masterofollies1234';
Now, the very first thing on any protected page ...
it starts out like this:
<?php
session_start();
if(isset($_SESSION['mof'])){
//do nothing
}
else{
header ("location: index.php");
}
.
.
.
the rest of your script follows.
If the SESSION is not set, it redirects back to "index.php" or wherever.
If the SESSION is set, you can either do nothing, or display something special.
It then drops down and executes the rest of your script.
.
Parry
01-05-2009, 02:44 PM
I am totally agreed with Mr.mlseim.
i think he was gave more useful information from others.
So,
Please take help of this person.
And
You also take help from me through My website. You also can asked questions frequently.
Thanks
_________________
bannerblindness (http://www.********************)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.