irgendwie bekomm ich es nich auf die reihe, daten in ne tabelle per php einzutragen
vllt wisst ihr ja was ich falsch mach - hier mal der code:
if($_POST["subadd"]){
$sql = "INSERT INTO anjin_news ( Titel , Datum , Inhalt , Autor ) VALUES ( ".$_POST["Titel"].", NOW( ) , ".$_POST["Inhalt"].", ".$_POST["Autor"].")";
echo "News wurde hinzugefügt.";
}
[...]
<form action="admin.php?open=news" method="post">
<label style="float:left;width:110px;"><img src="images/icons/application_form_edit.png" width="16" height="16" alt=""> <strong>Titel</strong></label>
<input type="text" name="Titel" onMouseOut="this.className='input_out'" onMouseOver="this.className='input_over'" value="<?php echo $row["Titel"]; ?>"><br>
<label style="float:left;width:110px;"><img src="images/icons/user.png" width="16" height="16" alt=""> <strong>Autor</strong></label>
<input type="text" name="Autor" onMouseOut="this.className='input_out'" onMouseOver="this.className='input_over'" value="<?php echo $session->username; ?>" readonly=""><br>
<label style="float:left;width:110px;"><img src="images/icons/application_edit.png" width="16" height="16" alt=""> <strong>Inhalt</strong></label>
<textarea cols="40" rows="10" name="Inhalt" onMouseOut="this.className='input_out'" onMouseOver="this.className='input_over'"><?php echo $row["Inhalt"]; ?></textarea><br>
<label style="float:left;width:110px;"> </label>
<input type="submit" name="subadd" value="Hinzufügen" onMouseOut="this.className='input_out'" onMouseOver="this.className='input_over'" style="font-weight:bold;">
</form>
verbindung zur datenbank besteht
gruß
sonic
Zuletzt modifiziert von Son!c am 16.11.2008 - 19:13:47

