我已经搜索过了,但找不到任何有效的东西,即使是不起作用也是如此:
index.php
:
<head>
<meta charset="utf-8">
</head>
<form action="upload.php" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
titel: <input style="width: 300px; margin-left: 104px;" type="text" name="titel">
<input type="submit" value="UPLOAD">
</form>
和upload.php
:
<head>
<meta charset="utf-8">
</head>
<?php
if(isset($_POST['titel']))
{
$con = mysqli_connect("localhost","trhdrth","fhrth","trhdrth");
$titel = mysqli_real_escape_string($con, $_POST['titel']);
mysqli_query($con, "INSERT INTO artikel (titel)
VALUES ('" . $titel . "')");
}
?>
当titel
为blablabla
时,我工作的所有内容都是смешные
,然后才能正常工作
如何正确做到?