PHP Classes

File: search.php

Recommend this page to a friend!
  Classes of Dave Smith  >  PHP Hulu Video  >  search.php  >  Download  
File: search.php
Role: Example script
Content type: text/plain
Description: Search example
Class: PHP Hulu Video
Generate HTML to embed Hulu videos in Web pages
Author: By
Last change:
Date: 6 years ago
Size: 1,135 bytes
 

Contents

Class file image Download
<?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>

For more information send a message to info at phpclasses dot org.