Click here to Skip to main content
15,886,199 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Review of Python Tools for Visual Studio Pin
Pete O'Hanlon13-Sep-11 22:01
mvePete O'Hanlon13-Sep-11 22:01 
Questionxml to html Pin
AndyInUK13-Sep-11 1:00
AndyInUK13-Sep-11 1:00 
AnswerRe: xml to html Pin
Matt Meyer13-Sep-11 11:19
Matt Meyer13-Sep-11 11:19 
AnswerRe: xml to html Pin
cjoki15-Sep-11 7:31
cjoki15-Sep-11 7:31 
AnswerRe: xml to html Pin
timoteui21-Sep-11 21:18
timoteui21-Sep-11 21:18 
QuestionOpenGL PinPopular
Iranian MM12-Sep-11 5:56
Iranian MM12-Sep-11 5:56 
AnswerRe: OpenGL Pin
TheGreatAndPowerfulOz12-Sep-11 12:32
TheGreatAndPowerfulOz12-Sep-11 12:32 
QuestionMono Pin
Iranian MM11-Sep-11 1:25
Iranian MM11-Sep-11 1:25 
AnswerRe: Mono Pin
fmiboy77711-Sep-11 22:50
fmiboy77711-Sep-11 22:50 
AnswerRe: Mono Pin
TheGreatAndPowerfulOz12-Sep-11 12:34
TheGreatAndPowerfulOz12-Sep-11 12:34 
AnswerRe: Mono Pin
Eddy Vluggen13-Sep-11 8:42
professionalEddy Vluggen13-Sep-11 8:42 
AnswerRe: Mono Pin
thatraja12-Nov-11 18:39
professionalthatraja12-Nov-11 18:39 
Questionlogin script returns blank page Pin
komanche10-Sep-11 2:05
komanche10-Sep-11 2:05 
AnswerRe: login script returns blank page Pin
Gerben Jongerius10-Sep-11 3:56
Gerben Jongerius10-Sep-11 3:56 
GeneralRe: login script returns blank page Pin
komanche12-Sep-11 1:42
komanche12-Sep-11 1:42 
AnswerRe: login script returns blank page Pin
Vasudevan Deepak Kumar10-Sep-11 12:57
Vasudevan Deepak Kumar10-Sep-11 12:57 
AnswerRe: login script returns blank page Pin
Marc Firth12-Sep-11 2:10
Marc Firth12-Sep-11 2:10 
GeneralRe: login script returns blank page Pin
komanche15-Sep-11 2:29
komanche15-Sep-11 2:29 
GeneralRe: login script returns blank page Pin
Marc Firth15-Sep-11 2:50
Marc Firth15-Sep-11 2:50 
Try to output the hashed (sha1) password, and compare it to the one in the database. i.e. for user "joe" with password "bloggs" run the following code and compare the output to the mysql query below


First get the hash you are creating when you log in (notice the "die"):
PHP
<?php
/**
** handles the login feature of the site
** check username and password with variables in the database
*/
require_once("../includes/ikobe.php");

if (isset($_POST['username']) && isset($_POST['password'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];

    $pass = sha1($password);
    die($pass);

    if (!empty($username) && !empty($password)) {
        $query = "SELECT id FROM users WHERE username = '$username' AND password='$pass' LIMIT 1";
        $query_run = mysql_query($query);
        $query_num_row = mysql_num_rows($query_run);

        if (mysql_num_rows($query_run) == 0) {
            echo 'Invalid username / password combination';
        } else {
            echo 'Ok.';
        }

    } else {
        echo 'You must supply a username and password.';
    }
}
?>



Then compare it to the one in the database:
PHP
<?php 
$query = "SELECT password FROM users WHERE username = 'joe' LIMIT 1";
$query_run = mysql_query($query);
while($row = mysql_fetch_array($query_run)){
    echo $row['password'];
}
?>


The two results should match.

GeneralRe: login script returns blank page Pin
Marc Firth15-Sep-11 3:22
Marc Firth15-Sep-11 3:22 
GeneralRe: login script returns blank page Pin
komanche17-Sep-11 3:08
komanche17-Sep-11 3:08 
QuestionOpenConnect fails with SSL connection failed Pin
Vasudevan Deepak Kumar9-Sep-11 6:20
Vasudevan Deepak Kumar9-Sep-11 6:20 
QuestionAnyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Vasudevan Deepak Kumar9-Sep-11 6:19
Vasudevan Deepak Kumar9-Sep-11 6:19 
AnswerRe: Anyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Bernhard Hiller12-Sep-11 22:17
Bernhard Hiller12-Sep-11 22:17 
GeneralRe: Anyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Vasudevan Deepak Kumar13-Sep-11 7:46
Vasudevan Deepak Kumar13-Sep-11 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.