Simple coding needed, please help :)

Discussion in 'PHP' started by bobisawsome7, Dec 2, 2006.

  1. #1
    Thanks for clicking :)

    I know nothing in PHP, but I think this is possible, and easy.

    I need a page which contains a Windows Media Player embedded. Let's say for example the page is called play.php. I would like the media play to play what comes after the page name in the address bar; example: ....com/play.php?=http://www.site.com/video.wmv

    Could anyone tell me about this, or please do this as a favour?


    Thanks a lot.
     
    bobisawsome7, Dec 2, 2006 IP
  2. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know the exact code to embed the media player in there. But whatever that code is you should have some spot where you place the filename of the movie you want to watch. So on the previous page your link should look something like this

     <a href="http://www.something.com?movie=coolvideo.mpg">Cool Video</a> 
    Code (markup):
    Then on the following page in your php code you should have the following

    
    //the below will get movie information, in this case 'coolvideo.mpg
    $movie=$_GET['movie'];
    
    PHP:
    then later you'll need to inject that into the spot where the movie name goes..

    
    <embedded movie object src="<?php echo $movie; ?>">
    
    Code (markup):
     
    klown, Dec 2, 2006 IP
  3. bobisawsome7

    bobisawsome7 Notable Member

    Messages:
    1,466
    Likes Received:
    104
    Best Answers:
    0
    Trophy Points:
    200
    #3
    The problem is though the videos played will be remotely hosted, so I don't think I can use that.


    Thanks for your reply, klown :)
     
    bobisawsome7, Dec 2, 2006 IP
  4. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It should operate the same, i have done a similar thing for pictures.
     
    klown, Dec 2, 2006 IP
  5. crazyden

    crazyden Guest

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You know... Windows Media player would be an ActiveX control, it has nothing common with PHP...
     
    crazyden, Dec 3, 2006 IP
  6. adsblog

    adsblog Active Member

    Messages:
    659
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    70
    #6
    that's basically code .
    you can check file format with ( get_headers()) to ignore injection attacks .

    if we have : play.php?http://www.abc.com/movi.mpg .script working fine .
    but when we have : play.php?http://www.ab.com/show.mpg"><iframe src='www.new.com'> script has security hole .
     
    adsblog, Dec 3, 2006 IP
  7. crazyden

    crazyden Guest

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You could use striptags() function
     
    crazyden, Dec 3, 2006 IP