有人告诉我我需要转义 $_POST 但是一旦我这样做了,我的变量就是空的。我错过了什么?
<?php
$order = $_POST['order'];
$heading = $_POST['heading'];
$content = $_POST['content'];
?>
<?php
echo $order . $heading . $content;
$order = mysqli_real_escape_string($order);
$heading = mysqli_real_escape_string($heading);
$content = mysqli_real_escape_string($content);
?>
<?php
echo $order . $heading . $content;
$sql="INSERT INTO faq (`order`, `heading`, `content`)
VALUES ('$order','$heading','$content')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";