was wondering how to code a server file for ajax calls ?,
example:
Class cars, have 2 functions
-
reply with all brands
return $database->Listall(‘brands’,’cardb’);
I call it with api.php?mod=list - reply with all cars in brand
return $database->Listall(‘cars’,’cardb’,”WHERE brand=$brand”);
I call it with api.php?mod=list&brand=kia
the problem is that google list these api links in its search directory, + users can also access this page on there own (not throu ajax call)
so how can i block this ?
AJAX is just a way to request a page that will return simplified (xml?) content.
Block Google
Use this on your robots.txt and serve your ajax requests from the ajax folder.
Use
_POSTon ajax requests and send a “secret”Have your AJAX requests send along a “secret” variable and, on requests that don’t have that variable just re-direct them to another page.