Simple JSON in PHP
a1.php
<?php
header('content-type: application/json; charset=utf-8');
$data = json_encode($_SERVER['REMOTE_ ADDR']);
echo $_GET['callback'] . '(' . $data . ');';
?>
test.php
<script type="application/javascript">
function getip(json){
alert(json);
}
</script>
<script type="application/javascript" src="http://localhost:90/test/ a1.php?callback=getip"></ script>
function getip(json){
alert(json);
}
</script>
<script type="application/javascript" src="http://localhost:90/test/
a1.php
<?php
header('content-type: application/json; charset=utf-8');
$data = json_encode($_SERVER['REMOTE_
echo $_GET['callback'] . '(' . $data . ');';
?>
0 comments:
Post a Comment