stoneharry

Untitled

Jun 16th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2. $account = $_GET["accountName"];
  3. $hash = $_GET["sessionKeyHash"];
  4.  
  5. $count = 0;
  6.  
  7. $con = mysql_connect('', '', ''); // censored
  8.  
  9. mysql_select_db('zzlogon', $con);
  10.  
  11. $q = mysql_query("SELECT `heading`,`read`,`hash` FROM `account_messages` WHERE account = '{$account}'") or die(mysql_error());
  12.  
  13. if (mysql_num_rows($q) != 0)
  14. {
  15.     echo "<headers>";
  16.    
  17.     while($row = mysql_fetch_array($q))
  18.     {
  19.         if ($hash == $row['hash'])
  20.         {
  21.             if ($row['read'] == 0)
  22.             {
  23.                 $head = $row['heading'];
  24.                
  25.                 echo "<header_entry id=\"{$count}\" priority=\"0\" opened=\"0\">";
  26.                 echo    "<subject>{$head}</subject>";
  27.                 echo "</header_entry>";
  28.                
  29.                 $count = $count + 1;
  30.             }
  31.         }
  32.     }
  33.    
  34.     echo "</headers>";
  35. }
  36.  
  37. mysql_close($con);
  38.  
  39. /*
  40. echo  "<headers>";
  41. echo    "<header_entry id=\"0\" priority=\"0\" opened=\"0\">";
  42. echo      "<subject>{$account}! {$hash}</subject>";
  43. echo    "</header_entry>";
  44. echo    "<header_entry id=\"1\" priority=\"0\" opened=\"0\">";
  45. echo      "<subject>Message 2</subject>";
  46. echo    "</header_entry>";
  47. echo    "<header_entry id=\"2\" priority=\"0\" opened=\"0\">";
  48. echo      "<subject>Message 3</subject>";
  49. echo    "</header_entry>";
  50. echo  "</headers>";
  51. */
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment