<?php
include "global_database_function.php"; //include config file
$nama_kategori = $_GET['nama_kategori']; //get from previous link
//global $nama_kategori;
//i can't use global $name_kategori
$idkategori = $_GET['idkategori'];
?>
<html>
<head>
</head>
<body>
<?php
//continue only if $_POST is set and it is a Ajax request
if(isset($_POST) && isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
{
//here is the code i try to show, i try to use:
htmlspecialchars($nama_kategori);
}
?>
</body>
</html>
如果我放在htmlspecialchars($nama_kategori);
body 和 之间if(isset($_POST) && isset
, 的值$nama_kategori
是可见的。