Results 1 to 4 of 4

Thread: need help in videos in PHP

  1. #1
    Join Date
    Feb 2009
    Posts
    156
    Thanks
    0
    Thanked 4 Times in 3 Posts

    Default need help in videos in PHP

    hi friends...

    i want to embedd the Youtube videos into my web page .. plz give me suggestions how i can embedd it with the help of PHP?
    is there any specific classes or coding to add videos...? means any user of my site can upload its favourite videos into his/her web page...

    Thanx in advanced for every suggestion

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Do you want a function like:
    PHP Code:
    youtube("id"); 
    Which would include the youtube video with the id id, or what?
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2009
    Location
    Florida
    Posts
    31
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    Create a function that takes the video ID and inserts it into the embed code.

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Here:
    PHP Code:
    <?php
    function include_youtube($id){
      return 
    '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'.$id.l=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$id.'&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';
    Usage:
    PHP Code:
    echo include_youtube('id'); 
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •