Location: PHPKode > scripts > YouTube Parser > example.php
<?php

$url = 'http://youtube.com/watch?v=vso9iPIpeu8';

if (isset($_POST['url'])) {
    require_once 'class.YouTubeParser.php';
    $parser = new YouTubeParser();
    $url = trim(stripslashes($_POST['url']));
    if (!($link = $parser->getVideoLink($url))) {
        echo $parser->errMsg;
    } else {
        echo '<a href="' . $link . '">DOWNLOAD VIDEO</a>';
    }
    echo '<br /><br />';
}

?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="url" value="<?php echo htmlspecialchars($url); ?>" style="width: 300px" />
<input type="submit" value="Go" />
</form>
Return current item: YouTube Parser