Hey Leute,
ich hab nen Problem an dem ich gerade verzweifel! =(
Ich will gerade ein mobil-Adminmenü für mein Blog machen damit ich nicht immer an Rechner muss aber der Input funktioniert einfach nicht!
Wäre echt super wenn einer von euch den Fehler findet.
html-Formular:
HTML
<?php
if($_GET['pw'] == "Passwort") { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mobile Admin(News) - Toms Blog</title>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"/>
<meta name="coypright" content="Tom Kay Witkowski"/>
<meta http-equiv="content-language" content="Deutsch (German) (de_DE)"/>
</head>
<body bgcolor="#ffffff" text="#000000" link="#a64906" vlink="#a64906" alink="#a64906">
<form action="m_news_input.php?pw=34626" method="post">
<fieldset style="width:90%; border:4px solid #a64906; background:#a8a8a8;">
<legend> Userauthentifikation </legend>
<label for="name">Username</label>
<input id="name" type="text" name="name" size="30" value="Username" />
<br />
<label for="pw1">Passwort</label>
<input id="pw1" type="password" name="pw1" size="30" value="Passwort" />
</fieldset>
<br />
<fieldset style="width:90%; border:4px solid #a64906; background:#a8a8a8;">
<legend> News hinzufügen </legend>
<label for="name">Betreff</label><br />
<input id="betreff" type="text" name="betreff" size="30" value="Betreff" />
<br />
<label for="kategorie">Kategorie</label>
<select id="kategorie" name="kategorie">
<option value="19">Fehlerlogs</option>
<option value="2">Downloads</option>
<option value="10">Spiele</option>
<option value="4">Grafikdesign</option>
<option value="5">Hardware</option>
<option value="6">Blog</option>
<option value="8">Programmierung</option>
<option value="9">Filme</option>
<option value="14">Sport</option>
<option value="18">Musik</option>
<option value="15">Fotografie</option>
</select>
<br />
<label for="news_short">kurz News</label><br />
<textarea id="news_short" cols="35" rows="5" name="news_short">kurz News</textarea>
<br />
<label for="news_long">lange News</label><br />
<textarea id="news_long" cols="35" rows="7" name="news_long">lange News</textarea>
</fieldset>
<br />
<fieldset style="width:90%; border:4px solid #a64906; background:#a8a8a8;">
<legend> Adminauthentifikation </legend>
<label for="pw2">Passwort</label>
<input id="pw2" type="password" name="pw2" size="30" value="Passwort" />
<br />
<label for="pw2">Senden</label>
<button id="send" type="submit">Senden</button>
</fieldset>
</form>
</body>
</html>
<?php }
else {
echo "Sie haben sich nicht richtig authentifiziert!"; }
?>
Alles anzeigen
Insert-Datei:
PHP
<?php
if($_GET['pw'] == "Passwort") {
$connectionid = mysql_connect ("localhost", "Name", "Passwort");
if (!mysql_select_db ("DB", $connectionid))
{
die ("Keine Verbindung zur Datenbank");
}
$sql1 = "SELECT ".
"* ".
"FROM ".
"fusion_users ".
"WHERE ".
"(user_name like '".$_POST['name']."') AND ".
"(user_password = '".md5($_POST['pw1'])."') AND ".
"(user_admin_password = '".md5($_POST['pw2'])."')";
$result = mysql_query($sql1);
if(mysql_num_rows($result) > 0) {
$breaks = "y";
$name = "1";
$null = "0";
$one = "1";
$sql2 = "INSERT INTO ".
"fusion_news (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_start, news_end, news_visibility, news_draft, news_sticky, news_allow_comments, news_allow_ratings, news_datestamp ) ".
"VALUES ('".$_POST['betreff']."', '".
$_POST['kategorie']."', '".
$_POST['news_short']."', '".
$_POST['news_long']."', '".
$breaks."', '".
$name."', '".
$null."', '".
$null."', '".
$null."', '".
$null."', '".
$null."', '".
$one."', '".
$one."', '".
time()."')";
mysql_query($sql2);
if(mysql_affected_rows($connectionid) > 0) {
echo "erfolgreicher Eintrag"; }
else {
echo "kein Eintrag"; }
}
}
?>
Alles anzeigen
MfG