I have the following code that runs on any PC and requests information for a PHP file on a remote server.
How do I pass a parameter to this PHP using this my JSON code?
So I can send a die and get a processed render.
I know it sounds like something simple, but I could only run this scenario (HTML anywhere) and PHP (remote server) with this code. All other methods need to have all the files on the server.
HTML file + JS (Run on any computer running)
<script type="text/javascript">
var urlTeste = 'http://www.meuservidor.com/servidor.php?jsoncallback=?';
$(document).ready(function() {
//Mensagem enquanto não carrega a pagina
$('#resultado').html('Carregando...');
$.getJSON(urlTeste,null, function(data){
$('#resultado').html(data);
});
});
</script>
PHP file (on server www.myserver.com/servers.php)
<?php
$var = date("d/m/Y H:i:s ");
echo $_GET["jsoncallback"] . '(' . json_encode($var) . ');';
?>
Thank you