Here is my sample.html file located in http://www.aaa.com/sample.html
<html>
<script>
$(document).ready(function(){
$.post('http://www.aaa.com/api/_file.php?act=add', {val : '1234'});
});
</script>
<body>
</body>
</html>
and this is my PHP file that recieve request from sample.html file
<?php
switch($_GET['act']){
case 'add' :
doFunction();
break;
}
function doFunction(){
echo $_POST['val'];
}
?>
if I have another html page like hack.html that located on another website, example http://www.bbb.com/hack.html
<html>
<body>
<a href="http://www.aaa.com/api.php_file.php?act=add">Hack them!!!</a>
</body>
</html>
Can I use bbb.com website to access data in aaa.com by cliking some link? If yes, how do I protect it?
Any idea? or better way?
Reguard. (^^)