maddog39
Feb 14 2005, 12:30 AM
Hello all, I found this script actually on another website. But I modded it and added some things. Heres the code and stuff. Open a new file in your text editor and paste in this code. CODE <?php { echo '<form name='pp' method='post' action='check.php'> Username:<input type='text' name='user' value=''><br> Password:<input type='password' name='pass' value=''><br> <input type='submit' value='Login'> </form>'; } ?>
Name this file login.phpNow open another new file in your text editor and paste in this code. CODE <?php // Change 'YourUsername' to whatever you want. if ($_POST['user'] == "YourUsername") { // Change 'YourURL' to the directory to forward to. echo "<meta http-equiv='refresh' content='0;URL=YourURL'>"; } else { header("Location: error.php"); } // Change 'YourPassword' to whatever you want. if ($_POST['pass'] == "YourPassword") { // Change 'YourURL' to the directory to forward to. echo "<meta http-equiv='refresh' content='0;URL=YourURL'>"; } else { header("Location: error.php"); } ?>
Name this file check.phpFor the last file, open up another new file in your text editor and paste in this code. CODE <?php echo "I am sorry, you have entered the username or password inccorectly. You are now being redirected."; echo "<meta http-equiv='refresh' content='2;URL=login.php'>"; ?>
Name this file error.php. Then upload these to your server and try them out. Its an easy way to password protect directories on a webserver. Demo: CLICK HEREDeno User: test Demo Pass: test
Reply
ill
Feb 14 2005, 05:45 AM
Interesting. I like it, I might put this to use for my "Slave" team.
Reply
bigboss
Feb 14 2005, 03:46 PM
thats interesting thanks for the tip
Reply
maddog39
Feb 14 2005, 07:52 PM
Your all welcome.
Reply
Taupe
Feb 15 2005, 03:21 PM
Don't forget to add <fieldset>s and <label>s in your forms...
Reply
maddog39
Feb 15 2005, 09:34 PM
What the heck do those do. The script works fine ive tried it and I use it.
Reply
Taupe
Feb 16 2005, 10:18 AM
Read this article, this one, this explaination., this checklist, this tutorial, this one and thiat one if you still don't know those basic tags... (And no : the script doesn't work fine : try to validate your page and you'll see...)
Reply
maddog39
Feb 19 2005, 06:00 AM
Looky here. I setup a demo for you guys, the user is test and the pass is test. Try it it works. Plus I dont know what you mean by vailidate it. Anyway I am going to clean up the code a little bit.
Reply
EricDrinkard
Feb 19 2005, 06:16 AM
Hey this might be what I am loking for...... Thank fo a while I have ben lookig for a logi system tha wa simple but not stupid. Thanks Eric Drinkad
Reply
maddog39
Feb 19 2005, 06:21 AM
Your welcome, I think I have fixed all of the bugs in it. Just tell if there are anymore. I have been testing and changing it like all night.
Reply
maddog39
Feb 21 2005, 08:03 PM
No if you want registered members than a MySQL database IS required. There is not possible way to do without it as far as I know.
Reply
rejected
Feb 21 2005, 06:43 PM
Could you set this up to where you can register, too? Like have it edit login.php so it adds the name into there?
Reply
Xedos
Feb 21 2005, 05:19 PM
I don't get you people and your exact code. Surely you've forgot a doctype once. Besides, it does work. Just because that stoopid W3 says it doesn't, doesn't mean the php won't work. God I hate W3
Reply
Similar Topics
Keywords : php, password, protect, w, o, db, php
- Make A Moderately-secure Password System Using Javascript
using file redirection to hide the password. (4)
Simple Javascript And Password System
How to protect your pages with password (6) The quickest way to get a password protection system up and running is to use a Prompt box in
JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
what the password should be, could even be one each, that can be sorted out at the next page then
pass the "input" directly through the url by changing the .href, like
http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
the referring page, and three fails from an IP if you like the php (the next page): CODE
<?php // processdo....
Change Your Computer Password
Change Your Computer Password (6) This Topic will teach how can you change your without knowing your old Passward 1. Click "Start"
Then Click "Run". 2. In the dialog box type in "CMD" and select "OK". (Opens Command Prompt) Or you
can manually open CMD by navigating to "C:\WINDOWS\system32\cmd.exe". 3. Once
Command Prompt is open, type in "net user" and hit enter. This will display all user accounts. 4.
Now type in the following command: " net user (ACCOUNTNAME) * " and hit enter Example: net user
Trap * (Dont forget to add the asterisk) 5. Now it will ask for a new password, enter....
How To Set A Password In Bios
the password is asked during start up (2) first let me tell you what is setting a password in bios is the password set at bios is asked when
you start your pc even before your operating system is booted heres the steps 1.as soon as you start
your pc press 'del' or 'Esc' continiously and you'll find the bios screen
2.when you spot the bios screen go to the security section in security section there are two option
of setting password 1.admin pass - you can't del this pass in bios without knowing the
password(only for advanced users) 2.user pass - you can delete bthis password from bios ev....
How To Protect A Directory From Being Viewed
without admin username and password (4) Well i ran across this script awhile back, and i am tired of storing it on my computer, so i am
going to post it here and whenever i need it i will come here and get it /biggrin.gif"
style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> hopefully Anyways, it is a
verry simple process just copy and paste this QUOTE if (($user) && ($passwort)) {
# get url $url = $DOCUMENT_ROOT . dirname($PHP_SELF) . "/.htpasswd"; # make
.htaccess and .htpasswd $htaccess_txt = "AuthType Basic" . "\n"; $htaccess....
Unencrypted But Invisible File Storage
It can have a password, it can be unlocked. (0) This method works, but unfortunately compression software can open the file without the password.
Also, you can try creating a new user account. When it asks "Make files and folders private?" click
Yes, make private. Name the new user account anything using NO spaces/uppercase letters, but not
something like "privatefiles" or something like that. Try accessing the files in C:\Documents
and Settings\ >. You cannot open the folder. Now to ensure that user is always hidden in My
Computer, click Start > Run. 1. Type in command.com . This should bring up a blac....
Get Rid Of Password Expiry
Windows xp (6) In this tut i'm going to tell u how to remove the psswd expiry in windows xp * Go to Start|Run
and type Control userpasswords2 * Go to Advanced tab in the user accounts window * Again select
the Advanced button under the Advanced user management header. * Now click on the User in the Local
Users and Groups. * On the right pane you will see the list of all user account * Right click on
the user name for which you want to change the setting and select the Properties option. *
Now click in the General tab check on the password never expires option. * Clic....
Making Winrar Archives
and adding password to winrar archives (12) **** This tutorial will show you how to put files into .rar Archive and pass worded (if wanted)
**** What You Will Need Before continuing you will need a couple of thing, first of all you
need WINRAR , which is a very powerful archive manager. It can reduce size for you email
attachments, decompress RAR, ZIP and other types of files downloaded from the internet. You can get
winrar at http://www.rarlabs.com The other thing is that make sure your using Windows XP because
this is what I used to make this tutorial. I think it works with any other windows not....
Wordpress 1.5 - Restricting Single Posts
Without having to enter a password for each post (1) This is a mini tutorial on how to tweak WordPress 1.5 so that anonymous readers or registered users
below a certain level (set by you) cannot view posts that you want to hide from them. They
won't even know that the posts exist. This is assuming that either 1. you are running a
blog/site that is meant to be administered by only one person (ie, you). OR 2. you want to let some
people co-author with you, but still need some posts to be restricted (more of a bloggers'
privacy issue). First Step : Download the Post Levels Plugin from http://fortes.com/projects....
Looking for php, password, protect, w, o, db, php
|
|
Searching Video's for php, password, protect, w, o, db, php
|
advertisement
|
|