/likeSong.php

https://bitbucket.org/wlynch92/cs336-dbproject · PHP · 19 lines · 17 code · 2 blank · 0 comment · 1 complexity · 2b3167e23a9ee8ca85e925c0bedec415 MD5 · raw file

  1. <HTML><BODY>
  2. <?php
  3. session_start();
  4. $connection = mysql_connect("cs336-64.rutgers.edu","csuser","cs277315");
  5. if (!$connection)
  6. {
  7. die('Cannot connect to server'); /*Prints to the browser*/
  8. }
  9. mysql_select_db("cs336",$connection);
  10. $likedSong = $_POST['LikeSong'];
  11. $user = $_SESSION['uid'];
  12. mysql_query("insert into likesSong values('$user','$likedSong')");
  13. mysql_close($connection);
  14. mysql_close($connection);
  15. header("Location: ".$_SESSION['url']);
  16. ?>
  17. </body></html>