Advertisement
vrondakis

Untitled

Feb 23rd, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. require("sql.php");
  3. session_start();
  4. $email = $_SESSION['uid'];
  5.  
  6. if(isset($_POST['down'])){
  7. $down = $_POST['down'];
  8. }
  9.  
  10. if(isset($_POST['up'])){
  11. $up = $_POST['up'];
  12. }
  13.  
  14. $type = $_GET['type'];
  15. $date = null;
  16.  
  17. if(!$type == "return"){
  18. $smt = $db->prepare("UPDATE downup SET user = ?, down = ?, up = ? WHERE user=?");
  19. if($smt->execute(array($email, $down, $up, $email))){
  20. echo "done";
  21. }
  22. } else if ($type == "return") {
  23. $smtR = $db->prepare("SELECT * FROM downup WHERE user=? LIMIT 4");
  24. $smtR->execute(array($email));
  25. $resul = json_encode($smtR->fetchAll());
  26. echo $resul;
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement