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>
Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i proceed? <a href="/spo/1437571200.html"
Drawing Images in classes
I'm quite new to Object Oriented PHP. What I'm trying to do is draw some images but also have other content on the page.Code: include('images.php');//New Image set$im=new images();//Sends headers and
Which PHP-Editor do you think is the best?
Hi everyone, Myself Brian Anderson. For the last 2 years i have been working as a php-professional. I would like to conduct a poll for knowing which PHP-Editor you guys think is the
Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?
serializing objects - loses methods - the point being?
HiI know that serializing an object will lose the methods. But whats the point in that? What if we need the methods . Lets say the serialized string is sent from an external server where the calling
search function
HI guys,if anyone could point us in the right direction of how to do this, or provide some test code for a similar problem would be great!Basically, I have user profiles on my site, and I have a
ldap connection
We are using ldap to get user information from the domain controller. It was working before. Recently I found the application is hanging at ldap_connect. It doesn't return any message. i am not sure
Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate, Mac OS 10?Anyone know how?Thanks
Add weeks in a query?
I have a SQL that summarizes the quantity per week. The weeks that has no value does not exist in the table. How can I add these missing weeks with a 0 value in the SQL. Need this to use Avg and
How to read posted binary data from a mobile device and post it to a web server?
Here is the senario...I have a mobile device (MD) that posts binary data to a Web Server (WS1) and that Web Server (WS1) posts that binary data (from the MD) to another Web Server (WS2).(MD)