Suche ein Forumlar um News einzutragen

TheManOfFire

Grünschnabel
Hi Leute.
Ich habe mir nen Admin bereich gemacht, und da sol jetzt ein Formular
sein, um News einzutragen weiss jemand wie des geht?
THX im vorraus
(Suche net des include sondern den form code:) )
 
edit:
Ich ahbe noch mal ge :google: t und habe was gefunden.
Also mein Code sieht für das formular so aus:

PHP:
<?php

echo "<form method=\"POST\" action=\"r.php\">
<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"50%\" id=\"AutoNumber2\">
  <tr>
    <td width=\"100%\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\" height=\"107\">
  <tr>
    <td width=\"100%\" colspan=\"2\" height=\"27\" bgcolor=\"#000080\">
    <p align=\"center\"><b><font face=\"Arial\" size=\"2\" color=\"#FFFFFF\">User
    Einfügen</font></b></td>
  </tr>
  <tr>
    <td width=\"25%\" height=\"19\" bgcolor=\"#E1E1E1\"><font face=\"Arial\" size=\"2\">
    Titel:</font></td>
    <td width=\"75%\" height=\"19\" bgcolor=\"#E1E1E1\">
    <input type=\"text\" name=\"titel\" size=\"73\"></td>
  </tr>
  <tr>
    <td width=\"25%\" height=\"19\" bgcolor=\"#CDCDCD\"><font face=\"Arial\" size=\"2\">
    Autor:</font></td>
    <td width=\"75%\" height=\"19\" bgcolor=\"#CDCDCD\">
    <input type=\"text\" name=\"Autor\" size=\"73\"></td>
  </tr>
<tr>
    <td width=\"25%\" height=\"19\" bgcolor=\"#CDCDCD\"><font face=\"Arial\" size=\"2\">
    Datum:</font></td>
    <td width=\"75%\" height=\"19\" bgcolor=\"#CDCDCD\">
    <input type=\"text\" name=\"Datum\" size=\"73\"></td>
  </tr>  
<tr>
    <td width=\"25%\" height=\"19\" bgcolor=\"#CDCDCD\"><font face=\"Arial\" size=\"2\">
    text:</font></td>
    <td width=\"75%\" height=\"19\" bgcolor=\"#CDCDCD\">
    <input type=\"text\" name=\"inhalt\" size=\"73\"></td>
  </tr> 
<tr>
    <td width=\"100%\" height=\"19\" bgcolor=\"#CDCDCD\" colspan=\"2\">
    <p align=\"center\"><input type=\"submit\" value=\"Anmelden\" name=\"B1\">
    <input type=\"reset\" value=\"Zurücksetzen\" name=\"B2\"></td>
  </tr>
</table>
</td>
  </tr>
</table>

    </center>
  </div>
</form>

</body>

</html>\n";

?>
und für die datei die es dann einfügt:
PHP:
<?php

include ("connect.php");

function adduser($id, $autor, $datum, $inhalt) {
$sql = "INSERT INTO `news` (`id` , `autor` , `datum` , `inhalt` ) VALUES ('$id', '$autor', '$datum', '$inhalt');"
;
$doing = mysql_query($sql)
or die (mysql_error());
{

}

adduser($id, $autor, $datum, $inhalt)
}
?>
Aber wenn ich einfügen will kommt:
Parse error: parse error, unexpected '}' in /r.php on line 15
 
Zuletzt bearbeitet:
PHP:
<?php

include ("connect.php");

function adduser($id, $autor, $datum, $inhalt) {
$sql = "INSERT INTO `news` (`id` , `autor` , `datum` , `inhalt` ) VALUES ('$id', '$autor', '$datum', '$inhalt');"
;
$doing = mysql_query($sql)
or die (mysql_error());
{

}

adduser($id, $autor, $datum, $inhalt);
}
?>

So müsste es gehen.
du hast ; bei adduser($id, $autor, $datum, $inhalt); vergessen gehabt
 
Zurück