Why is this alert deleted successfully or garbled?

<?php
header("Content-type: text/html; charset=utf-8"); 
require("conn.php");
$id = intval($_GET["id"]);
$sql = "delete from lyb where ID = $id";
if ($mysqli->query($sql) === true) {
    echo "<meta http-equiv="Content-Type"  content="text/html; charset=utf-8">"; 
    echo "<script charset="utf-8" type="text/javascript">alert("");location.href="5-6.php";</script>";
} else {
    echo "" . $mysqli->error;
    echo  "<script>location.href="5-6.php"</script>";
}
$mysqli->close();
?>

Apr.09,2021

write a utf-8 code and you won't make a mistake


see what your php code is.


mysql setting utf-8

Menu