jeudi 1 octobre 2015

how to use php IF looping to show value of a variable that taken from method GET on previous link?

<?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>

if I put htmlspecialchars($nama_kategori); between body and if(isset($_POST) && isset, the value of $nama_kategori is visible.

Aucun commentaire:

Enregistrer un commentaire