Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1 image with a playbutton image on top of it
here is the page that generates the image:
http://jnerocorp.com/playbutton.php?id=J7VjUYGpsWM
and that works fine
but this requires that I get the id in this code which if ?id= is not set then it redirects and sets it and then that link will work but i am getting a redirection error
the url is here:
http://jnerocorp.com/youtube.php
here is the code:
Code: <?php
if(isset($_GET['url'])) {
$original = $_GET['url'];
$youtubelink = $_GET['url'];
$youtubelink = str_replace("http://", "", "$youtubelink");
$youtubelink = str_replace("www.", "", "$youtubelink");
$get_id = explode("/", $youtubelink);
$get_id = explode("&", $get_id[1]);
$get_id = str_replace("watch?v=", "", "".$get_id[0]."");
$thumbnail_default = str_replace("%id%", "$get_id", "http://img.youtube.com/vi/%id%/default.jpg");
$thumbnail_1 = str_replace("%id%", "$get_id", "http://img.youtube.com/vi/%id%/1.jpg");
$thumbnail_2 = str_replace("%id%", "$get_id", "http://img.youtube.com/vi/%id%/2.jpg");
$thumbnail_3 = str_replace("%id%", "$get_id", "http://img.youtube.com/vi/%id%/3.jpg");
$image = str_replace("%id%", "$get_id", "http://img.youtube.com/vi/%id%/0.jpg");
if(!isset($_GET['id'])) {
header("Location: http://www.JneroCorp.com/youtube.php?url=$original&?id=$get_id");
}
}
?>
<html>
<head>
<title> Youtube Thumbnail grabber </title>
<style type="text/css">
div.thumbs
{
position:absolute;
left:5px;
top:20px;
}
div.video
{
position:absolute;
left:400px;
top: 150px;
}
div.bigimage
{
position:absolute;
left: 850px;
top: 150px;
border: 1px;
}
</style>
</head>
<body>
<center>
<h1> Youtube Thumbnail Grabber </h1>
</center>
<?php
if(!isset($_GET['url'])) {
?>
<center>
<form action="" method="GET">
URL: <input type="text" name="url" size="35">
<input type="submit" value="Get Thumbnail!">
</form>
</center>
<?php
} else {
echo "<div class='thumbs'>Youtube Video ID: <b> $get_id <b>
Thumbails::
Default:
<img src='$thumbnail_default'>
Thumbnail 1:
<img src='$thumbnail_1'>
Thumbnail 2:
<img src='$thumbnail_2'>
Thumbnail 3:
<img src='$thumbnail_3'>
";
if(isset($_GET['id'])) {
$id = $_GET['id'];
echo "PlayButton Thumb:
<img src='http://JneroCorp.com/playbutton.php?id=$id'></div> ";
}
?>
<div class='video'>
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/<?php echo $get_id; ?>&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/<?php echo $get_id; ?>&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</div>
<?php echo "<div class='bigimage'><img src='$image'></div>"; ?>
<?php
}
?>
</body>
</html>
mySQL and PHP search
Hello,I am trying to code a project and ran into a brick wall with one of my pages. I am pretty new at php/mySQL and can not figure this out. Now I know that you are not going to sit there and type my
Why is this query failing?
Why is this not working?$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID AND `pin` = " . $PIN;$result = mysql_query($query) or die("Web site query
strtotime issue
Hey all,I'm playing around with some code, and basically the idea is:Person changes their profileI fetch some XML that has a unix timestamp for the time the person changed their profile, so it'll keep
HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane. When the ddl selection is changed, I programatically change the selected index of the accordian to
Comma seperated implode & modifying returned string.
I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be combined into one comma seperated string (eg variable1,variable2,variable3,variable4). This i can do
Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a designer than coder and I can't figure this out. It is on the following
Need help Updating SQL Server Express DB from c# :(
Please can anyone help with:-
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to another and whoever they have subscribed to is echoed back on there profile page. my users table
How to display objects in a row
I have 7 codes that i want to display in a row one next to another.The first is {$ads->ads_display('1')}, the second {$ads->ads_display('2')} and so on...They appear one under the other.
Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are ticked then I want it to display all vehicle roof heights. However it doesn't work correctly, for