B
bdt600
Guest
Hallo??? Jemand zu Hause???Achso. Woher soll ich denn wissen, das du noch vom Formular redest.
Nö, tut es nicht. Das Formular sendet per Post name, text und commentOK und per Get kommt page rüber.
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Hallo??? Jemand zu Hause???Achso. Woher soll ich denn wissen, das du noch vom Formular redest.
Nö, tut es nicht. Das Formular sendet per Post name, text und commentOK und per Get kommt page rüber.
if(isset($_POST["commentOk"]))
{
include "include/design/db_connect.php";
$cName = $_POST['name'] ;
$cText = $_POST['text'];
$aID = $_GET['bid'];
$cDate = date("Y.m.d");
if($cName == "" or $cText == "")
{
echo "Du hast nicht alle Felder ausgefüllt.";
} else {
$query = "INSERT
INTO
`comments`
SET
`aID` = " . mysql_real_escape_string($_GET["bid"]) . ",
`author` = '" . mysql_real_escape_string($_POST['name']) . "',
`text` = '" . mysql_real_escape_string($_POST['text']) . "',
`date`=now()";
mysql_query($query)
or die ("MySQL-Error: " . mysql_error());
}
mysql_close($verbindung);
}
<form action="index.php?page=blog&bid=<?php $_GET['bid'] ?>" method="post">
MySQL-Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `author` = 'dfgdf', `text` = 'fbdfb', ' at line 5
<form action="index.php?page=blog" method="post">
Name:</br>
<input type="text" name="name"><input type="hidden" value="<?php $_GET['bid'] ?>" name="blogid"></br>
Kommentar:</br>
<textarea id="area" name="text"></textarea></br>
<input type="submit" name="commentOk" value="Senden"></br>
</form>
<?php echo $_GET['bid'] ?>
Daran hab ich in meiner Verzweiflung wahrscheinlich nicht gedacht.Wie wäre es denn mal mit Grundlagen lernen?
PHP:<?php echo $_GET['bid'] ?>