<?PHP
 
error_reporting(E_ALL ^ E_NOTICE);
 
 
//manage form submission for browser history
 
if( !empty($_REQUEST['formSubmitted']) ){
 
    header('location: search.php?search='.$_REQUEST['search']);
 
}
 
 
include('hulu.class.php');
 
$hulu = new hulu;
 
 
$search = ( empty($_REQUEST['search']) ) ? '' : trim($_REQUEST['search']);
 
 
if( !empty($search) ){
 
    $hulu->searchHulu($search);
 
}
 
?>
 
<html>
 
    <head>
 
    </head>
 
    <body>
 
        <form method="post">
 
            <div>
 
                You must have downloaded Hulu's public sitemaps for search capabilities. There is over 500MB of data to search, so be patient, it will take a minute.
 
            </div>
 
            <div style="margin-top: 10px;">
 
                Keyword: <input type="text" name="search" value="<?PHP echo (!empty($_REQUEST['search'])) ? $_REQUEST['search'] : '';?>"><br>
 
            </div>
 
            <div style="margin-top:10px;"><input type="hidden" name="formSubmitted" value="1"><input type="submit" value="Get Results"> [<a href="search.php">Start Over</a>]</div>
 
        </form>
 
<?PHP
 
if( !empty($hulu->huluResult) ){
 
    echo 'Search returned these results...<br><br>';
 
    var_dump($hulu->huluResult);
 
}
 
?>
 
    </body>
 
</html>
 
 
 |