PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/like.php

https://bitbucket.org/wlynch92/cs336-dbproject
PHP | 20 lines | 16 code | 4 blank | 0 comment | 1 complexity | 1e0b3d0e5112e53df056567941f09d01 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. $likedArtist = $_SESSION['artistID'];
  11. $user = $_SESSION['uid'];
  12. mysql_query("insert into likesArtist values('$user','$likedArtist')");
  13. header("Location: ".$_SESSION['url']);
  14. mysql_close($connection);
  15. ?>
  16. <HTML><BODY>