Inloggen script werkt niet meer

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Kevin Zegikniet

Kevin Zegikniet

29/11/2012 12:15:00
Quote Anchor link
Hallo mensen,

Ik heb een site gemaakt, met een inlogsysteem. Tot voor kort werkte dit prima.

Ik heb laatst echter de database opnieuw "geinstalleerd". Dat wil zeggen:
- De scripts met toegevoegde kolommen opnieuw invoeren
- Een eerste script (test script, werd niet meer gebruikt) eruit gehaald

Als ik nu wil inloggen, kom ik weer op de hoofdpagina terecht, zoals ingesteld. De error die via de sessie mee moet, komt echter niet op het scherm.
Ik krijg ook geen error dat hij geen database, tabel of kolom kan vinden. Ik krijg helemaal niks.

Kan iemand mij helpen?
Hieronder staan het index.html script en het inlog.php script.

INDEX.html
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
?>


<html>
<head>
<title>Forever Alone Dating - Home</title>
</head>
<body>
<center><a href="index.html"><img border="0" src="/Dating/WIP/Forever_Alone_Dating.png" alt="Forever Alone Dating" width="428" height="263"></a></center> <br />

<div style="text-align: center;"><big style="font-weight;">
Welkom op onze hoofdpagina!<br />
U kunt hieronder inloggen of registreren:<br /> <br />

<!-- <table align="center">
<tr>
    <td>
    <font align="center", color="#FF0000"
        <?php
            print $_SESSION['error_inlog'];
        ?>

    </font>
    </td>
</tr>
</table> -->

<table align="center">
<form action="inlog.php" method="post">
<tr><td width="114">
<div style="text-align: right;"><style="font-weight;">Gebruikersnaam:</td>
<td width="200"><input type="text" size="30" name="username">
</div></td></tr>
<tr><td>
<div style="text-align: right;"><style="font-weight;">Wachtwoord:</td><td> <input type="password" size="30" name="password">
</div></td></tr>
<tr><td width="114"></td> <td width="200"><input type="submit" value="Inloggen!">
</form></td></tr>
</table>

<br /><br />
Heb je nog geen account?<br />
<form action="registratie.php" method="post">
<input type="hidden" name="controle" value="FALSE">
<input type="submit" value="Registreren!">
</form>
</div>
<br /><br />
<div style="text-align: right;"><small style="font-weight;"><small><small>
<br /><br />
(C) Dyanthe Brouwer & Kevin Nauta 2012</small></small></div>
</body>
</html>


INLOG.php
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
session_start();

mysql_connect("localhost", "root", "") or die("Kan niet verbinden met de database: " . mysql_error());
mysql_select_db("datingsite") or die("Kan de database niet vinden: ". mysql_error());

$md5_pass=md5($_POST['password']);
$_SESSION['username']=$_POST[username];

$sql_inlog = mysql_query (
        "SELECT id
        FROM user
        WHERE Username = '"
. mysql_real_escape_string($_POST['username']) . "'
              AND Password = '"
. ($md5_pass) . "'
        "
);
$_SESSION['id']=$row['id'];
IF($sql_inlog === false)
    {
echo 'Error 1: ' . mysql_error(); }
else {
    IF ((mysql_fetch_row($sql_inlog))!= '1')
        {
$_SESSION['error_inlog']="ECHO: Verkeerde gegevens ingevuld !!" ;
        // echo $_SESSION['error_inlog'];
        header("Location: index.html");}
    else {
    // Kijk of lijst 1 ingevuld is, zo niet stuur door naar lijst 1
    $sql_l1 = mysql_query (
            "SELECT provincie
            FROM user
            WHERE username = '"
. ($_SESSION['username']) . "'
            "
) ;
    if ($sql_l1 === false)
        {
echo 'Error2    : ' . mysql_error(); }
    else {  $info = mysql_fetch_row($sql_l1);
        if ($info[0] == '')
            {
$_POST['controle']="FALSE";
            header('Location: lijst1.php'); }
        else {// Kijk of lijst 2 ingevuld is, zo niet stuur door naar lijst 2
            $sql_l2=mysql_query(
                "SELECT Provincie
                FROM partner
                WHERE username = '"
. ($_SESSION['username']) . "'
                "
);
            if ($sql_l2===false)
                {
echo"Er is een fout op regel " . __LINE__ ; }
            else {  $info = mysql_fetch_row($sql_l2);
                if ($info[0] == '')
                    {
$_POST['controle']="FALSE";
                    header('Location: lijst2.php'); }
                else { //Ga naar profiel
                    /* if(mysql_num_rows($sql_inlog) == 1)
                        { $_SESSION['username']=$_POST[username];
                        $_SESSION['id']=$sql_inlog; */

                        header('Location: profiel.php'); }
                    /* else
                        { $_SESSION['error_inlog']="Verkeerde combinatie ingevuld!";
                        header('Location: index.html'); } */

                    }
                }
            }
        }
    }



?>


Alvast bedankt!
Gewijzigd op 29/11/2012 12:15:52 door Kevin Zegikniet
 
PHP hulp

PHP hulp

19/04/2024 07:25:10
 
Kevin Zegikniet

Kevin Zegikniet

30/11/2012 22:48:22
Quote Anchor link
Is zelf al opgelost.
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.