I am trying to work with youtube API and trying to send a link from html page to my php script.(I am actually creating an API). But when I click on submit, nothing happens !! even the page is not loaded
Here is my html page
<html>
<title>Youtube Video Information</title>
<body>
<h3>Paste Video Url in the below box</h3>
<form name = "input" name = "input" action="youtubev3.php" method="GET">
<input type = "textarea" name = "videoURL" id = "videoURL"><br>
Comments: <input type = "checkbox" name = "comments"><br>
likes: <input type = "checkbox" name = "likes"><br>
dislikes: <input type = "checkbox" name = "dislikes"><br>
Views: <input type = "checkbox" name = "dislikes"><br>
<input type="button" name="submit" value="submit" name = "submit">
</form>
</body>
</html>
And here is my php source code.
<?php
class youtubev3{
function __construct()
{
}
function getdata(){
$string = $_POST['videoURL'];
$urlID = trim($string,"https://www.youtube.com/watch?v=");
echo $urlID;
$jsonObject = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id={$urlID}&key=AIzaSyDvM6lnjHv5YMBA6I7ROjv2yYbnohN4PNY&part=snippet,contentDetails,statistics,status");
$json = json_decode($jsonObject);
$comentCount = $json->{'kind'};
//var_dump($json);
//echo $videoType;
}
}
$getData1 = new youtubev3();
$getData1->getData();
// $videoType = $json->{'items'}[0]->{'kind'};
?>
I hope my question is clear enough.
$string. I'd call that "undefined index..."inputoftype=textarea?