mamo
02.12.2007, 12:33
Also mein Problem ist : Irgendwie werden $_POST["title"] und $_POST["text"] nicht in die Datenbank eingetragen. Dort sehe ich nur die Variable $admin_name die von der config.inc.php geincludet wird.
Hier der Code :
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Loginbereich</title>
<style>
table, input, button {
border: 1px solid #00003E;
background-color: #0099FF;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color:#00003E;
}
body {
background-color: #0066CC;
background-image: url(images/plantet.png);
background-attachment: fixed;
background-position: bottom right;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<?php
include('config.inc.php');
if(!isset($_GET["submit"])) {
if ($_GET["code"] == $panel_password) {
echo '
<center>
<table>
<tr>
<td width="100%" align="center">
<a href="index.php">Logout</a> : <a href="postnews.php?code=.$panel_password.">News schreiben</a> : <a href="editnews.php?code=.$panel_password.">News bearbeiten</a> : <a href="help.php?code=.$panel_password.">Hilfe</a>
</td>
</tr>
<tr>
<td>
<form action="postnews.php?code=';
echo $panel_password;
echo '" method="post">
Titel :<input size="50" type="text" name="title" /><br />
Text<br />
<textarea style="float:left" rows="10" cols="50" name="text"></textarea>
<table style="width:60px; height:30px;">
<tr>
<td width="100%"><pre><img src="';echo $domain;echo '/planet/images/smile1.gif" /><img src="';echo $domain;echo '/planet/images/smile2.gif" /><img src="';echo $domain;echo '/planet/images/smile3.gif" /><img src="';echo $domain;echo '/planet/images/smile4.gif" />
<img src="';echo $domain;echo '/planet/images/smile5.gif" /><img src="';echo $domain;echo '/planet/images/smile6.gif" /><img src="';echo $domain;echo '/planet/images/smile7.gif" /><img src="';echo $domain;echo '/planet/images/smile8.gif" /></pre>
<br />
</td>
</tr>
</table><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<input name="submit" value="Posten" type="submit" />
</form>
</center>
';
if (!isset($_POST["submit"])) {
$f = mysql_query("INSERT INTO `planet_news` (`author` , `title` , `text`) VALUES ('".$admin_name."', '".$_POST["title"]."', '".$_POST["text"]."');");
$err = mysql_error();
if (mysql_error() == 1) {
echo "Fehler : $err";
}
}}}
?>
</body>
</html>Warum wird nur der Name aus der Config Datei eingefügt ?
MySQL sagt auch nichts...
Ich kriege es einfach nicht hin...
Hier der Code :
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Loginbereich</title>
<style>
table, input, button {
border: 1px solid #00003E;
background-color: #0099FF;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color:#00003E;
}
body {
background-color: #0066CC;
background-image: url(images/plantet.png);
background-attachment: fixed;
background-position: bottom right;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<?php
include('config.inc.php');
if(!isset($_GET["submit"])) {
if ($_GET["code"] == $panel_password) {
echo '
<center>
<table>
<tr>
<td width="100%" align="center">
<a href="index.php">Logout</a> : <a href="postnews.php?code=.$panel_password.">News schreiben</a> : <a href="editnews.php?code=.$panel_password.">News bearbeiten</a> : <a href="help.php?code=.$panel_password.">Hilfe</a>
</td>
</tr>
<tr>
<td>
<form action="postnews.php?code=';
echo $panel_password;
echo '" method="post">
Titel :<input size="50" type="text" name="title" /><br />
Text<br />
<textarea style="float:left" rows="10" cols="50" name="text"></textarea>
<table style="width:60px; height:30px;">
<tr>
<td width="100%"><pre><img src="';echo $domain;echo '/planet/images/smile1.gif" /><img src="';echo $domain;echo '/planet/images/smile2.gif" /><img src="';echo $domain;echo '/planet/images/smile3.gif" /><img src="';echo $domain;echo '/planet/images/smile4.gif" />
<img src="';echo $domain;echo '/planet/images/smile5.gif" /><img src="';echo $domain;echo '/planet/images/smile6.gif" /><img src="';echo $domain;echo '/planet/images/smile7.gif" /><img src="';echo $domain;echo '/planet/images/smile8.gif" /></pre>
<br />
</td>
</tr>
</table><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<input name="submit" value="Posten" type="submit" />
</form>
</center>
';
if (!isset($_POST["submit"])) {
$f = mysql_query("INSERT INTO `planet_news` (`author` , `title` , `text`) VALUES ('".$admin_name."', '".$_POST["title"]."', '".$_POST["text"]."');");
$err = mysql_error();
if (mysql_error() == 1) {
echo "Fehler : $err";
}
}}}
?>
</body>
</html>Warum wird nur der Name aus der Config Datei eingefügt ?
MySQL sagt auch nichts...
Ich kriege es einfach nicht hin...