Getting the response of another server using include
is disabled by default in the php.ini for security reasons, most likely you won’t be able to use it. Use file_get_contents
instead.
In your file.php
you can make a json response using your data and echo it:
<?php
$email = $_REQUEST['email'];
$name = $_REQUEST['name'];
$a = "testing";
header('Content-type: application/json');
echo json_encode(
'email' => $email,
'name' => $name,
'a' => $a
);
?>
And in the A.php
you need to parse the json string to get your data:
<?php
$data = json_decode(file_get_contents('http://10.1.1.12/a/file.php?email=aaa@a.com&name=abc'));
echo $data['email'], ' ', $data['name'], ' ', $data['a'];
?>