Hallo,
was mache ich falsch?
Fehler:
Wie aus dem Code hervorgeht, ist die Verbindung erfolgreich, nur der Code nicht.
Code:
Alles anzeigen
Ich hoffe jemand kann mir helfen... :)
Viele Grüße,
Chris
was mache ich falsch?
Fehler:
Wie aus dem Code hervorgeht, ist die Verbindung erfolgreich, nur der Code nicht.
Code:
PHP-Quellcode
- <?php
- $host = "localhost";
- $user =
- $pw =
- $db = "
- $connection = mysql_connect($host,$user,$pw);
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="de">
- <head>
- <title>User Control Panel</title>
- <link rel="stylesheet" href="style.css" type="text/css" />
- </head>
- <body>
- <div id="body">
- <div id="logo">
- <center><big><big><big>ChrisG3TV</big></big></big> <br><big><big><big><big><big>CONTROL PANEL</big></big></big></big></big></div>
- </center><br>
- <div id="container">
- <?php
- $username = @$_POST["user"];
- $passwort = @$_POST["passwort"];
- $query = mysql_query('SELECT * FROM `userdate` WHERE `user`="'.$username.'" AND pw="'.$passwort.'"');
- if(mysql_num_rows($query) == 1)
- {
- echo "Herzlich Willkommen!<br>";
- if(!connection){
- echo "Verbindung zum MySQL Server fehlgeschlagen.<br>";
- } else {
- echo "Die Verbindung zum MySQL Server steht.<br>" ;
- }
- $selecting = mysql_select_db($db);
- if(!selecting){
- echo "Verbindung zur Datenbank fehlgeschlagen.<br>";
- } else {
- echo "Die Verbindung zur Datenbank steht.<br>" ;
- }
- ?>
- <meta http-equiv="refresh" content="5; url=adminhome.php">
- <script type="text/javascript"> function countDown(init) { if (init || --document.getElementById( "counter" ).firstChild.nodeValue > 0 )
- window.setTimeout( "countDown()" , 1000 ); } </script> </head> <body onload="countDown(true)"> <br>Weiterleitung in <span id="counter" class="dd">5</span> Sekunden.</b>
- <?php
- }
- else
- {
- echo "Login Fehlgeschlagen, Sie werden jetzt zurück zur Homeseite geleitet.<br>";
- if(!connection){
- echo "Verbindung zum MySQL Server fehlgeschlagen.<br>";
- } else {
- echo "Die Verbindung zum MySQL Server steht.<br>" ;
- }
- $selecting = mysql_select_db($db);
- if(!selecting){
- echo "Verbindung zur Datenbank fehlgeschlagen.<br>";
- } else {
- echo "Die Verbindung zur Datenbank steht.<br>" ;
- }
- ?>
- <meta http-equiv="refresh" content="5; url=index.php">
- <script type="text/javascript"> function countDown(init) { if (init || --document.getElementById( "counter" ).firstChild.nodeValue > 0 )
- window.setTimeout( "countDown()" , 1000 ); } </script> </head> <body onload="countDown(true)"> <br>Weiterleitung in <span id="counter" class="dd">5</span> Sekunden.</b>
- <?php
- }
- ?>
- </div>
- <?php require_once('unten.php'); ?>
- </div>
- </body>
- </html>
- <?php
- mysql_close($connection);
- ?>
Ich hoffe jemand kann mir helfen... :)
Viele Grüße,
Chris