[web]Pass Protect

Junior Spellweaver
Joined
Jan 21, 2009
Messages
148
Reaction score
8
I dont know if anyone wants this but say if you want to have seperate CP's for Admins GMs and players, you can pass word protect a page so Only GMs and such can access other 'certain features'.

I dunno....I'm trying to learn php. C is to hard:ott1:

Code:
<?php 

// Define your username and password 
$username = "someuser"; 
$password = "somepassword"; 

if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { 

?> 

<h1>Login</h1> 

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 
    <p><label for="txtUsername">Username:</label> 
    <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> 

    <p><label for="txtpassword">Password:</label> 
    <br /><input type="password" title="Enter your password" name="txtPassword" /></p> 

    <p><input type="submit" name="Submit" value="Login" /></p> 

</form> 

<?php 

} 
else { 

?> 

<p>Insert text here. :P </p> 

<?php 

} 

?>
 
Re: Pass Protect

You could just use the auth function in XAMPP. [It's in the XAMPP directory. Htdocs -> Forbidden. You could just put the site you want to "protect" in that folder.]
 
Re: Pass Protect

You could just use the auth function in XAMPP. [It's in the XAMPP directory. Htdocs -> Forbidden. You could just put the site you want to "protect" in that folder.]

I dont like using XAMPP its seems to confusing...I prefer Wamp2
 
..or you could make it so it would check the users accesslevel on the database and if it's higher than 800 the user can see the admin/GM panel, else he would get redirected somewhere else. ftw.
good luck learning PHP
 
..or you could make it so it would check the users accesslevel on the database and if it's higher than 800 the user can see the admin/GM panel, else he would get redirected somewhere else. ftw.
good luck learning PHP

lol:laugh:
This is not in the php begginer guide, wait until learn, and release more proyects.
This, only allowe to enter with one user and pass.I think is usseles for now, we must wait for better one
Good look learning php:thumbup:
 
I was looking at a tutorial (for begginers) and the first thing that came to mind was "wtf?"

Lolz,its quite easy,iam currently learning C++,first on my thought was,"wtf is the purpose of this guide,
is it teaching me how to code in command promp only or is it only have cout << bla2.."

but then i keep learning and on my thought i always said "C++ is easy" everytime even if its not,haha

but i managed to find out the purpose of it when i was like in half of the books,its really help alot :)

just keep on learning,eventually ull get to it,C++ is mostly like math lolz!!
 
Back