Log in

View Full Version : page.html?type=HD script



dkblackhawk
04-25-2009, 06:33 PM
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.

X96 Web Design
04-25-2009, 11:10 PM
That would be PHP... So your file extension would have to be .php.

Then, just put this into the video page:

<?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!

dkblackhawk
04-26-2009, 01:45 AM
That would be PHP... So your file extension would have to be .php.

Then, just put this into the video page:

<?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

Nile
04-26-2009, 01:56 AM
You got the t_strong error, because:


if(isset($_GET['type']) == HD) {

Should be:


if((isset($_GET['type'])) && $_GET['type'] == "HD"){

Schmoopy
04-26-2009, 02:05 AM
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.

Nile
04-26-2009, 02:12 AM
Just remembered this thread:
http://www.dynamicdrive.com/forums/showthread.php?t=31462

X96 Web Design
04-26-2009, 05:58 PM
Oops... Sorry about the mistype... :o

// X96 \\

dkblackhawk
04-28-2009, 12:49 PM
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 $key="sd"; echo stripslashes(get_post_meta($post->ID, $key, true)); ?> and the other one
<?php $key="hd"; echo stripslashes(get_post_meta($post->ID, $key, true)); ?>

is there a way to put those to codes into the one you gave nile and X96 Web Design?