I have used the cURL solution to solve XSS but there is an issue with it. My proxy.php file contents are:-
<?php
$url = "http://www.yahoo.com";
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
?>
And this is how i am trying to execute php script
$("#tempButton").click(function(){
$("#pageContent").load('http://localhost:8080/proof/proxy.php',function() {
var t = $("#pageContent").html();
alert(t);
});
});
But variable t is showing the contents of proxy.php file while it is expected to show contents of yahoo.com which was set in proxy.php file. Am i doing something silly. #FirstTimePHP
<?php ?>tags when accessing it from the web.