<?php
$page = "http://neopets.com/login.phtml?username=test&password=test&destination=/stockmarket.phtml";
$ch = curl_init($page);
// set URL and other appropriate options
//curl_setopt($ch, CURLOPT_URL, "http://neopets.com/login.phtml?username=TEST&password=TEST&destination=/stockmarket.phtml");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
echo curl_exec($ch);
$info = curl_getinfo($ch);
$retrievedhtml = file_get_contents("http://neopets.com/stockmarket.phtml");
if (!preg_match("#<marquee>(.*)<\/marquee>#i", $retrievedhtml, $match)){
echo ":-(";
}
else{
echo $match[0];
}
curl_close($ch);
echo $match[0];
?>
Is there anything wrong with that?
Also, it turns out there's a piece of javascript that blocks scripts from logging in, any way to bypass?