Results 1 to 8 of 8

Thread: page.html?type=HD script

  1. #1
    Join Date
    Sep 2008
    Posts
    44
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default page.html?type=HD script

    I want a script that whenever someone on my site is looking at a sd video and i have a link for hd and they click on that link, then the player switches to hd video. How can i do this? Example is http://www.gametrailers.com/player/48435.html when you want to switch to hd it becomes http://www.gametrailers.com/player/48435.html?type=mov and it changes the player file etc.

  2. #2
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    That would be PHP... So your file extension would have to be .php.

    Then, just put this into the video page:
    PHP Code:
    <?php
      
    if(isset($_GET['type']) == HD) {
        echo 
    "<object... (etc)"//any quotation marks ( " " ) should be preceded by a slash: \"
      
    } else {
        echo 
    "<object... (etc)"// For the non-HD video, quotation mark thing applies to this as well.
      
    }
    ?>
    Hope that helps!
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

  3. #3
    Join Date
    Sep 2008
    Posts
    44
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by X96 Web Design View Post
    That would be PHP... So your file extension would have to be .php.

    Then, just put this into the video page:
    PHP Code:
    <?php
      
    if(isset($_GET['type']) == HD) {
        echo 
    "<object... (etc)"//any quotation marks ( " " ) should be preceded by a slash: \"
      
    } else {
        echo 
    "<object... (etc)"// For the non-HD video, quotation mark thing applies to this as well.
      
    }
    ?>
    Hope that helps!
    how can it be in php if it is a html file? and no that didnt help i kept on getting a t_string error. on line 3

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

    Default

    You got the t_strong error, because:
    Code:
    if(isset($_GET['type']) == HD) {
    Should be:
    Code:
    if((isset($_GET['type']))  && $_GET['type'] == "HD"){
    Jeremy | jfein.net

  5. #5
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    But that's beside the point, the page has a .html extension so PHP can't be used, time to call in the JavaScript gurus methinks.

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

    Default

    Last edited by Nile; 04-26-2009 at 02:19 AM.
    Jeremy | jfein.net

  7. #7
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    Oops... Sorry about the mistype...

    // X96 \\
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

  8. #8
    Join Date
    Sep 2008
    Posts
    44
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thanks for all of your replies, but now i am having a little bit of trouble chaning niles code here, i can go the js way or php way, i am using wordpress but the only way i get the embed code in the file is using another php code aswell
    PHP Code:
    <?php $key="sd"; echo stripslashes(get_post_meta($post->ID$keytrue)); ?>
    and the other one
    PHP Code:
    <?php $key="hd"; echo stripslashes(get_post_meta($post->ID$keytrue)); ?>
    is there a way to put those to codes into the one you gave nile and X96 Web Design?

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
  •