Skip to content

Instantly share code, notes, and snippets.

@gupul2k
Created September 27, 2014 23:29
Show Gist options
  • Save gupul2k/b47ba8847735e7350054 to your computer and use it in GitHub Desktop.
Save gupul2k/b47ba8847735e7350054 to your computer and use it in GitHub Desktop.
IMDB Movie Output in JSON
<html>
<body>
<?php
$movie=$_GET["mname"];
$yr=$_GET["year"];
// echo $movie;
$movie = str_replace(' ', '%', $movie);
$json=file_get_contents("http://www.omdbapi.com/?t=$movie&y=$yr");
$info=json_decode($json);
print_r($info);
?>
</body>
</html>
<html>
<body>
<form action="IMDB_Api.php" method="get">
Movie Name: <input type="text" name="mname"><br>
Year: <input type="text" name="year"><br>
<input type="submit">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment