well i don't know anything about my sql. so dous anybodey know where i get this thing? or what it is 
pasword gate
Whats do you mean by a password gate?
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 ?
If so, you can use a .htaccess file.
http://www.javascriptkit.com/howto/htaccess3.shtml
Or write something in php.
http://www.javascriptkit.com/howto/htaccess3.shtml
Or write something in php.
... or if you want it really simple but secured properly (including image files etc.) you can just use DirectAdmin's "Password Protected Directories" feature. 
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!
Well, enjoy!
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:
Then, on each page you want secured via this login, you simply check:
Hope this helps.
| 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.
A note on Jeremy's suggestion. You must validate everything you get from GET, POST, cookies, or $_SESSION. They can all be faked.
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.
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: |
| 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; } ?> |
I think , he don't know what he wants?.
Clear the things.
Clear the things.
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
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
