Advertisement
Guest User

Untitled

a guest
May 26th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $url1 = json_decode(file_get_contents('http://www.movie.com:/retrieveMovies'), true);
  3. foreach ($url1 as $movie) {
  4.     $movieID = $movie['movieId'];
  5.  
  6.     $url2 = json_decode(file_get_contents(' http://movie.com/movieOne?seatNum=' . $movieID), true);
  7.     $testingResult = $seat['avail'];
  8.     echo "<button onclick = testBTN('" . $testingResult . "')>Seat ID</button>";
  9. }
  10. ?>
  11. <script>
  12.     function testBTN(x) {
  13.         if (x == "OK") {
  14.             alert("Seat booked");
  15.         }
  16.         else {
  17.             alert("Error in booking seats");
  18.         }
  19.  
  20.     }
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement