ok ich hab hier ein paar php scripte und möchte wissen wo die fehler sind. Wenn ich die scripte hochladen kommen fehlermeldungen die zeilen die als falsch angegeben sind hav ich in den scripten mit <------- markiert. Wenn möglich schreibt noch dazu wie ich die db`s einstellen muss.
Die scripte behandeln eine membersverwaltung.Die scripte sind auf
(script1) http://peits.host.sk/login/anmeldung.php
(script2) http://peits.host.sk/login/login.php
(script3) http://peits.host.sk/login/tuorials.php
(script4) http://peits.host.sk/login/workedit.php
hochgeladen.
script1:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass);
mysql_select_db(logindb,$conn_id);
if ($Pass !=$Pass2){
mysql_close($conn_id);
die("Passwort 1 und 2 nicht identisch");
}
else{
$Pass = md5($pass);
$query = "insert into logindb (name, passwort, email) VALUES ('$Name','$Pass','$mail')";
$result = mysql_query($query);
if (!result){
echo mysql_error();
die("Datenbankfehler");
}
else{
mysql_close($conn_id);
header("Location: login.php");
}
?>
</body>
</html><-------
script2:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass);
mysql_select_db(logindb,$conn_id);
$query = "select * from logindb order by id desc";
$result = mysql_query($query);
while($row=mysql_fetch_array($result)){
$id = $row['id'];
$Passwort = $row['passwort'];
if (md5($Pass) == $passwort){
@session_start();
$register = base64_encode($Passwort);
$nummer = $id;
session_register("register");
session register("nummer"); <-------
echo"<center>Kennwort ist korrekt.
<p> </p>
<form method=\"POST\" action=\"workedit.php\">
<p><input type=\"submit\" value=\"Weiter\" name=\"B1\"></p>
</form>
</center>
";
exit;
}
else{
mysql_close($conn_id);
die("Kein Zugang");
}
}
?>
</body>
</html>
script3
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass); <-------
mysql_select_db(textdb,$conn_id); <-------
$query = "select * from textdb order by id desc";
$result = mysql_query($query); <-------
if (!result) echo mysql_error();
echo "<table>";
while($row=mysql_fetch_array($result)){ <-------
$id = $row['id'];
$name = $row['name'];
$text = $row['text'];
$text = nl2br(stripslashes($text));
echo " <tr>
<td>Eintrag von: $name</td>
</tr>
<tr>
<td>Text: $text</td>
</tr>
<tr>
<td><hr></td>
</tr>\n";
}
echo "</table>";
?>
</body>
</html>
script4:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,peits,548145);
mysql_select_db(logindb,$conn_id);
session_start();
$query = "select * from logindb where id = '$id'";
$result = mysql_query($query);
$row=mysql_fetch_array($result)
$Passwort = $row['passwort']; <-------
if ($register != base64_encode($kennwort)){
die("Kein Zugang");
exit;
}
else{
$text = addslashes($text);
$query = "insert into textdb (name, text) VALUES ('$Name','$text')";
$result = mysql_query($query);
if (!result){
echo mysql_error();
die("Datenbankfehler");
}
else{
mysql_close($conn_id);
header("tutorials.php");
}
}
?>
</body>
</html>
Die scripte behandeln eine membersverwaltung.Die scripte sind auf
(script1) http://peits.host.sk/login/anmeldung.php
(script2) http://peits.host.sk/login/login.php
(script3) http://peits.host.sk/login/tuorials.php
(script4) http://peits.host.sk/login/workedit.php
hochgeladen.
script1:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass);
mysql_select_db(logindb,$conn_id);
if ($Pass !=$Pass2){
mysql_close($conn_id);
die("Passwort 1 und 2 nicht identisch");
}
else{
$Pass = md5($pass);
$query = "insert into logindb (name, passwort, email) VALUES ('$Name','$Pass','$mail')";
$result = mysql_query($query);
if (!result){
echo mysql_error();
die("Datenbankfehler");
}
else{
mysql_close($conn_id);
header("Location: login.php");
}
?>
</body>
</html><-------
script2:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass);
mysql_select_db(logindb,$conn_id);
$query = "select * from logindb order by id desc";
$result = mysql_query($query);
while($row=mysql_fetch_array($result)){
$id = $row['id'];
$Passwort = $row['passwort'];
if (md5($Pass) == $passwort){
@session_start();
$register = base64_encode($Passwort);
$nummer = $id;
session_register("register");
session register("nummer"); <-------
echo"<center>Kennwort ist korrekt.
<p> </p>
<form method=\"POST\" action=\"workedit.php\">
<p><input type=\"submit\" value=\"Weiter\" name=\"B1\"></p>
</form>
</center>
";
exit;
}
else{
mysql_close($conn_id);
die("Kein Zugang");
}
}
?>
</body>
</html>
script3
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,user,pass); <-------
mysql_select_db(textdb,$conn_id); <-------
$query = "select * from textdb order by id desc";
$result = mysql_query($query); <-------
if (!result) echo mysql_error();
echo "<table>";
while($row=mysql_fetch_array($result)){ <-------
$id = $row['id'];
$name = $row['name'];
$text = $row['text'];
$text = nl2br(stripslashes($text));
echo " <tr>
<td>Eintrag von: $name</td>
</tr>
<tr>
<td>Text: $text</td>
</tr>
<tr>
<td><hr></td>
</tr>\n";
}
echo "</table>";
?>
</body>
</html>
script4:
<html>
<head>
<title></title>
<meta name="author" content="x´S">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<?php
$conn_id = mysql_connect(db.host.sk,peits,548145);
mysql_select_db(logindb,$conn_id);
session_start();
$query = "select * from logindb where id = '$id'";
$result = mysql_query($query);
$row=mysql_fetch_array($result)
$Passwort = $row['passwort']; <-------
if ($register != base64_encode($kennwort)){
die("Kein Zugang");
exit;
}
else{
$text = addslashes($text);
$query = "insert into textdb (name, text) VALUES ('$Name','$text')";
$result = mysql_query($query);
if (!result){
echo mysql_error();
die("Datenbankfehler");
}
else{
mysql_close($conn_id);
header("tutorials.php");
}
}
?>
</body>
</html>
Kommentar