I made a little experiment with my site. I have a site, that is empty. Then it makes an AJAX-Request to a php file where a random website is being gathered. The website is being gathered by using multiple random words, doing a search request with them to google and select a random result. Then with curl I follow that result and print out the contents, and set the in my ajax-request into my html. Then, normally the next page should be gathered.
How would I fix this? This is my code. As I said, it's just an experiment, so I'm not using Prototypes, classes, tests, comments or whatever, just plain stupid writing the code down
And this is where I get the site contents and print them out in the php file (I'm not showing the full code here, because there is stuff you don't need)
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $final);
$content = curl_exec($ch);
$final is the URL of the google result. Any ideas?