Yes, you need a site/server to generate the information, and another to read the answer. (I think I understand the purpose).
If so, you would have to create requests, for a GET on the other server, it returns a JSON.
To limit access we would use . htaccess as a limiter for separate IP connections. I don’t know if it would work SERVER to SERVER, just like using the client, but it can be a simple alternative.
(There are several ways to create a TOKEN security standard as well as common webservices).
In practice:
Data generation would have to have its trigger, in case a GET request.
www.your.com/yourURLnaoAmigavel.php? trigger=SEUS_PARAMETROS
if(isset($_GET['gatilho'])){
$abc = array();
$abc[]['title']=$valor;
$abc[]['image']=$valor2;
echo json_encode($abc).
}
In the end, I would use the PHP function json_encode($abc)
;
Output Example:
[
{
"title": "Título do artigo",
"image": "http://...."
......
},
{
"title": "Título do artigo 2",
"image": "http://...."
......
}
]
Now let’s go to Jquery, with the answer processing.
$.ajax({
url:'www.seuservidor.com/suaURLnaoAmigavel.php?gatilho=SEUS_PARAMETROS',
cache:false,
method:'GET',
success:function(d){
d=JSON.stringify(eval("(" + d + ")"));
d=(JSON.parse(d));
for(var inf=0;inf<=d.length;inf++){
$('#ondevcquiser').append(d[inf]['title']);
}
}
});
Remembering that I only gave you the very generic code, you’ll have to work on it if it really helped you.
Good luck, I hope I helped you!
in fact whether to share the database?
– MagicHat
No, I only want limited information about the articles securely in which only the second site can access
– user45722
You can do an XML feed on one site and pull the information on the other.
– Sam