Ich bin neu Stackoverflow. Ich möchte dieses Formular erstellen, das Informationen in die Datenbank hochlädt. Wenn ich auf "Senden" klicke, wird es nicht hochgeladen. Ich habe meine Verbindungsdatei überprüft und das ist korrekt. Code unten. Bitte helfen Sie.php register zur datenbank
<?php
include("/connections/db_conx.php");
if (isset($_POST['submit'])) {
$title = mysqli_real_escape_string($_POST['title']);
$text = mysqli_real_escape_string($_POST['text']);
$picture = mysqli_real_escape_string($_POST['picture']);
$sql = "INSERT INTO news (title, text, picture) VALUES('$title','$text','$picture', now(),now(),now())";
$query = mysqli_query ($db_conx, $sql);
echo 'Entered into the news table';
}
?>
<html>
<head>
</head>
<body>
<table border="0">
<tr>
<form method="post" action="index.php" id="tech">
<td>Title</td><td> <input type="text" name="title"></td> </tr>
<tr> <td>Text</td><td> <textarea rows="4" name="text" cols="50" name="comment" form="tech"> </textarea>
</td> </tr>
<tr> <td>Picture</td><td> <input type="varchar" name="picture"></td> </tr>
<tr> <td><input id="button" type="submit" name="submit" value="Submit"></td>
</tr>
</form>
</table>
</body>
</html>
[Little Bobby] (http://bobby-tables.com/) sagt *** [Ihr Skript ist für SQL Injection Attacks gefährdet.] (Http://stackoverflow.com/questions/60174/how- can-i-prevent-sql-injection-in-php *** Erfahren Sie mehr über [vorbereitete] (http://en.wikipedia.org/wiki/Prepared_statement) Anweisungen für [MySQLi] (http://php.net /manual/de/mysqli.quickstart.prepared-statements.php). Sogar [die Zeichenfolge zu entkommen] (http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string) ist nicht sicher! –
Die Anzahl der Felder und die Anzahl der Werte stimmen nicht überein. – lkdhruw
Erhalten Sie einen Fehlercode? – GrumpyCrouton