FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


pasword gate





gandalf88
well i don't know anything about my sql. so dous anybodey know where i get this thing? or what it is Smile
ncwdavid
Whats do you mean by a password gate?
TomS
I think he wants a memberarea. So that only people can see a certain content, if they have the right password. Am I right, gandalf88 ?
the zephyrus
If so, you can use a .htaccess file.
http://www.javascriptkit.com/howto/htaccess3.shtml
Or write something in php.
ChrisCh
... or if you want it really simple but secured properly (including image files etc.) you can just use DirectAdmin's "Password Protected Directories" feature. Smile
Diablosblizz
http://pixel2life.com has many mysql tutorials. You should check it out, or yes you can use DirectAdmin's password protect folders (which is .htaccess).

Well, enjoy!
jeremyw
What you may be wanting is to have a login screen. You can have users log in, checking the password against a database on the way in. You can then control access to inner pages via a session. This is fairly simple PHP to implement. If they log in successfully, you set their username as a session variable:
Code:
$_SESSION['username'] = $username

Then, on each page you want secured via this login, you simply check:
Code:
if(!isset($_SESSION['username']))
{
print "You must log in before viewing this page";
exit;
}

Hope this helps.
the zephyrus
A note on Jeremy's suggestion. You must validate everything you get from GET, POST, cookies, or $_SESSION. They can all be faked.
santium
Here's a function that I use to validate if someone is allowed to visit a certain page, and if not, log it into the database.

Code:
function validatePage ($userID, $pageID) {
$sqlpdata = mysql_query("SELECT * FROM pages WHERE pageid = '$pageID'");
$pagedata = mysql_fetch_array($sqlpdata);
$sqlulvl = mysql_query("SELECT * FROM users WHERE userid = '$userID'");
$udata = mysql_fetch_array($pagedata);
if ($udata['level'] >= $pagedata['level']) {
 return 1;
}
else {
 mysql_query("INSERT INTO log (userid, pageid) VALUES ('$userID', '$pageID')");
 return 0;
}
}


Of course, you'll need the database backend for it. You can either make one or PM me for it.
But to use this, you need to assign each protected page a number that way it can be logged and checked against required level to view.
An example of how to use this:
Code:
<?php
session_start();
if (!validatePage($_SESSION['userid'], '1')) {
echo "You are not allowed to visit this page.. You need atleast a level of Administrator to view";
die;
}
?>
ritesh26
I think , he don't know what he wants?.
Clear the things.
manum
k... so first of all mySQL is a dbms just like oracle....

it goes very well with a server side scripting language called PHP

secondly a password gate is a server side script to protect your private pages in ur website and only lets the registered users to see them

there are many such kinda scipts already written and available for free for newbies... u can find some at php.resourceindex.com

happy learning
Related topics
What software do you use to design?
There's One Born Every Minute
Tools you use
Airlines Announcements!!
English is "Speaked" here
12 classics comprehending :
Super to chase after the girls the past master (exceed makin
11:11 The Gate
Naruto Gate
star gate : Atlantis S2
pasword gate
eeeem bondings i lost my pasword and my home email changed
What was Golden Gate Scandal?
Baldur's Gate
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.