View Full Version : Possible to use PHP to embed Youtube Videos

03-12-2008, 07:06 PM
Was just wondering if it was possible to do this.

My think was to have a input box that the user could paste the youtube link into. This would then save the path to the file in the database and then when viewing the selected item it would use the url to get the video.

Would i be along the right lines or is this not even possible?

Andrew Johnson
03-12-2008, 07:12 PM



<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/<?php echo $_POST["YouTubeID"]; ?>"> </param> <embed src="http://www.youtube.com/v/<?php echo $_POST["YouTubeID"]; ?>" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object>

} else {

<form method="post" action="">
YouTube ID: <input type="text" name="YouTubeID" />



03-12-2008, 10:46 PM
Cheers mate, thought it was simple, and it was.