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>
What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.* to 5.2.4. Not just PHP was upgraded, MySQL, postGres, and (I think) Apache were upgraded as well.
php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecure, some simple, some lack of attachment capability, some use redirect, etc. How does one find the
help with database debug pls
Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Getting PHP to ammended the selected in option field
Hey Guysthanks for everyones help so far. This site and its users are oozing awesomness.I am busy with a php script for editing users, of which 1 field is the TITLE of the person (mrs, miss, ms) and
How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I have been recently assigned a project, in which I have got to extract/download the contents of the
The IE or FF detector
Hello Friends,Problem of today ( we seek for php help ) as following ,we know all that PNG images not shown well on IE6 and some "css'ers" given us a solution --> fine 1but if that
php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]
Why do I get this error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a5488351/public_html/bbdemo.php on line 90Code:<?php session_start(); ?><?php require
Converting RGB values to HEX
Code: <?PHP$file_handle = fopen("colors/rgb.csv", "r");while (!feof($file_handle) ) {$line_of_text = fgetcsv($file_handle, 1024);print $line_of_text[2] . $line_of_text[3] .
Create a form of 2 numbers input and find the greatest.
Hi, everybody.I have a homework in my training of php, which ask you to make a form that asks you to input 2 numbers and so tell you which number is greater than the other.I need to know how to make