View Single Post
Old 02-14-2008, 09:47 AM   #17 (permalink)
StevenF
The Contributor
 
Join Date: Jan 2008
Posts: 87
Thanks: 49
StevenF is on a distinguished road
Default

Quote:
Originally Posted by SOCK View Post
Obviously what you've posted isn't your login script; can you show us that?
See, I told you I was tired. I posted the register script by mistake.

PHP Code:
<?php

    
//Database Structure
        //Setting username and password
        
$username="";
        
$password="";
        
$database="scotlandbands";

        
mysql_connect($localhost$username$password) or die ('<strong>MySQL Error:</strong>'.mysql_error());
        
mysql_select_db($database) or die ('<strong>MySQL Error:</strong>'.mysql_error());
        
        
//Setting variables from form data
        
$user $_POST['check_username'];
        
$pass $_POST['check_password'];
        
$login $_POST['login'];
        
        
$get mysql_query("SELECT count(userID) FROM users WHERE user_name = '$user' AND user_pass = '$pass'");
        
$result mysql_result($get,0);
        
        
mysql_close();
        
        
//Determine if there is a result
        
if ($result != 1header ("Location: login.html");
        else {
            
header ("Location: index.html");
            
$_SESSION['user_name'] = $user;
            };
            
            
?>
I'm getting somewhere now: If I take out the md5 encryption, and register a username and password, I can use that to log in. But, when I try it with md5 encryption, I can't login! Do I have to decrypt it or something?

This is how I'm using md5:

PHP Code:
$reg_password md5($_POST['reg_password']); 
__________________
My Personal and Photo Blog

Last edited by StevenF : 02-14-2008 at 10:32 AM.
StevenF is offline  
Reply With Quote