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>
this code is not working????
it says this error.. Warning: Division by zero in ..the variables are correct, so why is the variable $max zero??/Code: $sw = $_GET['w']; $sh = $_GET['h'];
What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is going wrong. It's a set of filters for events. The filter marked "type" (category) works
grouping within a foreach?
hello all,I currently have a list of products spit out from my db via a foreach loop. Right now I am styling these as a <li>I want to style the list so that the annual and the monthly
Read from a text file after a specific word
Hi all. I have a text file that looks like the one below. I know how to open the text file but I need to get the php pointer to take a value suck as $username. Once it finds $username, i need it to
Career Change into SAP
Hai
asking for direction
I have 2 tables in my data, which are "post" and "event"I won't make a summary page for showing the condition of these two tables.so what I am thinking is SELECT the fields inside
chat
hello i'm amir
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :if (isset($_POST['sub1'])) { $id = $_POST['cscstest']; $qty = $_POST['cscsqty']; $id =
Multiple upload and Resize
I would like some help on my script I have the for my index.php////<html><head><!-- Include the javascript --><script
Multiple PHP errors when clicking a link..and..removing a ghost..
Hi - I have 2 problems with a new website - homeswapvacations.com, which I need help solving.The first problem - In the left column (on all pages) is "Featured Listing" column (in the admin