Toon posts:

[PHP] Waarom werkt deze submit niet?

Pagina: 1
Acties:
  • 39 views sinds 30-01-2008

Verwijderd

Topicstarter
Hij wilt maar niet submitten, kan er maar niet achter komen waarom niet.
Iemand die het toevallig ziet? ;)
code:
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>
<head>
<link href="css/style.css" rel=StyleSheet type=text/css>
<title>Warlocks from Hell, an Unreal Tournament InstaGib clan</title>
</head>
<body bgcolor="#262223">
<?

include "config.php";

mysql_connect("$host", "$usr", "$ww") or die("Connectie met Database mislukt");
mysql_select_db("$db") or die("Fout bij het selecteren van de database");

if ($HTTP_COOKIE_VARS["gebruikersnaam"] != "")
{
    echo "<h3>Al ingelogd</h3>";
    echo "Je bent al ingelogd, nog een keer inloggen is niet nodig";
}
else
{
    if ($inloggen)
    {
        $gebruikersnaam = trim("$gebruikersnaam");
        $wachtwoord = trim("$wachtwoord");

        if (!$gebruikersnaam || !$wachtwoord)
        {
            echo "<h3>Inloggen &rsaquo; Fout</h3>";
            echo "Je hebt je gebruikersnaam of wachtwoord niet ingevuld, <a href=\"javascript:history.go(-1)\">Ga terug</a>";
            exit;
        }
        $select_lid = "SELECT * FROM leden WHERE gebruikersnaam='$gebruikersnaam'";
        $query_lid = mysql_query($select_lid);
        $bestaat_lid = mysql_num_rows($query_lid);
        $list_lid = mysql_fetch_object($query_lid);

        if ($bestaat_lid == "0")
        {
            echo "<h3>Inloggen &rsaquo; Fout</h3>";
            echo "Deze gebruikersnaam bestaat niet, <a href=\"javascript:history.go(-1)\">Ga terug</a>";
            exit;
        }
        
        if ($list_lid->wachtwoord != "$wachtwoord")
        {
            echo "<h3>Inloggen &rsaquo; Fout</h3>";
            echo "Het wachtwoord klopt niet, <a href=\"javascript:history.go(-1)\">Ga terug</a>";
            exit;
        }
        else
        {
            setcookie("gebruikersnaam", "$gebruikersnaam", time() +604800, "/");

            echo "<h3>Inloggen &rsaquo; Ingelogd</h3>";
            echo "Je bent succesvol ingelogd als <b>$gebruikersnaam</b>!";
        }           
    }
    else
    {
            echo "<table width=\"100%\" style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
            echo "<tr><td width=\"80%\" background=\"images/bar.gif\" style=\"BORDER-BOTTOM: #000000 1px solid\"><b>&nbsp;Users:</b></td></tr>";
            echo "<tr><td bgcolor=\"#333333\">";            
            echo "<table border=\"0\" cellpadding=\"2\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">";
            echo "<form action=\"$PHP_SELF\" method=\"post\">";
            echo "<tr><td width=\"100%\" bgcolor=\"#333333\">";
            echo "<table border=\"0\" align=\"center\">";
            echo "<tr><td>&nbsp;<font color=\"#ff9933\">Login</font></font>";
            echo "</td>";
            echo "<td><input type=\"text\" name=\"gebruikersnaam\" size=\"18\" class=\"regular\" maxlength=\"18\">";
            echo "</td></tr>";
            echo "<tr><td>&nbsp;<font color=\"#ff9933\">Password</font></font>";
            echo "</td>";
            echo "<td><input type=\"password\" name=\"wachtwoord\" size=\"18\" class=\"regular\" maxlength=\"18\">";
            echo "</td></tr>";
            echo "<tr><td colspan=\"2\" align=\"right\"><input type=\"image\" name=\"inloggen\" src=\"images/login.png\" onMouseOver=\"src='images/login2.png'\" onMouseOut=\"src='images/login.png'\" valign=\"bottom\" border=\"0\" value=\"Log in\" class=\"button\">";
            echo "</td></tr>";
            echo "</table>";
            echo "</td></tr>";
            echo "</table>";
    }
}

?>
</body>
</html>

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

Zo werkt het niet :)

Kijk naar de output van print_r($_POST/$HTTP_POST_VARS) en/of print_r($_GET/$HTTP_GET_VARS)

Dit topic is gesloten.