When building an Ajax Gateway, ie a file that is invoked by the object XmlHTTPRequest JavaScript, you can inadvertently create a tunnel for unwelcome intrusion. In fact, being a file like the others, located on our server is reachable from the address bar of your browser. Fortunately there is a simple way to identify the type of request:
1 2 3 4 5 |
In this way we prevent calls from the address bar of your browser. The chicciola (@, at) is not strictly necessary, however, if the headers were already sent to the page, you could get an unpleasant Warning.










To me, this script does not work ... the ajax calls remain as "stale" ...
@ Michael: Probably depends on your server, especially PHP ones. ] viene impostata automaticamente dall'ambiente server quando riceve una richiesta dall'oggetto
XmlHTTPRequest. The variable$_SERVER [ 'HTTP_X_REQUESTED_WITH' ]is set automatically from the server when it receives a request from the objectXmlHTTPRequest. Try checking your settings, partly because it works for me ...@ Giovambattista Fazioli: Excuse my ignorance, but I do not know how to check this setting
@ Michael: If you can not ask your server administrator, make good the script that you used, perhaps the problem is in code and not the server. ] o, se possiedi FireFox con FireBug, alla verifica dei dati inviati e ricevuti sulla rete. Try a simple check on the
$_SERVER [ 'HTTP_X_REQUESTED_WITH' ]or, if you have FireFox with FireBug, verification of data sent and received on the network.