Thread: Admin Login
View Single Post
09-11-2007, 10:32 PM
#5
Xuxa is offline Xuxa
Status: Request a custom title
Join date: Feb 2006
Location: USA
Expertise:
Software:
 
Posts: 1,076
iTrader: 17 / 95%
 

Xuxa is on a distinguished road

Send a message via MSN to Xuxa

  Old

Make a file with 2 variables like the following

Protect.php
PHP Code:
<?php

$USER_LOGIN  
'usernamehere';
$USER_PASS 'md5encryptedpw';

?>
Then for the login make it see if it's correct

PHP Code:
<?php

// Form process code above

$FORM_LOGIN $_POST['login'];
$FORM_PASS md5($_POST['password']);

// Checks to see if the submitted data from the form matches with set login info
if( $FORM_LOGIN == $USER_LOGIN && $FORM_PASS == $USER_PASS ) {

// If it has the combination has been successful echo, redirect, or what you to do here

} else {

// If the combination failed then do whatever you want (e.g. Dispaly an error message)

}

?>
That is very basic....you can also do it with a database and you can include cookies and such. Hope that helped