Advertisement
Guest User

Untitled

a guest
Nov 24th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2.  
  3. if(!defined('INCLUDE_CHECK')) die('Denne fil kan ikke blive kørt direkte');
  4.  
  5. define('DB_USERNAME', 'nodebook_dk');
  6. define('DB_PASSWORD', '******');
  7. define('DB_NAME', 'nodebook_dk_db');
  8. define('DB_HOST', 'mysql13.unoeuro.com');
  9.  
  10.  
  11.  
  12. try {
  13. $iws_db = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME."", DB_USERNAME, DB_PASSWORD);
  14.  
  15.  
  16. }
  17. catch(PDOException $e)
  18. {
  19. echo $e->getMessage();
  20. }
  21.  
  22. $mysql_connection = mysql_connect ('mysql13.unoeuro.com', 'nodebook_dk', '******');
  23. mysql_select_db ('nodebook_dk_db');
  24.  
  25.  
  26. function aktiv($bruger_id) {
  27. GLOBAL $mysql_connection;
  28. $premium_query = mysql_query("SELECT aktiv FROM brugere WHERE id = '".$bruger_id."'", $mysql_connection);
  29.  
  30. if (mysql_num_rows($premium_query) > 0) {
  31. $premium = mysql_result($premium_query, 0, 'aktiv');
  32. if ($premium =='1') return true;
  33. }
  34. return false;
  35. }
  36.  
  37. $aktiv = (aktiv($_SESSION['id']));
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement