Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (!$_POST) { ?>
- <form action="" method="post">
- YouTube URL: <input type="text" name="url" /><br />
- <input type="submit" name="submit" value="Submit me!" />
- </form>
- <?php } ?>
- <?php
- error_reporting(E_ALL);
- if ($_POST) {
- $request_url = 'http://www.youtube.com/oembed?url='.urlencode($HTTP_POST_VARS['url']).'&format=xml';
- $xml = simplexml_load_file($request_url) or die("feed not loading");
- echo $xml->html[0];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement