Advertisement
Guest User

Untitled

a guest
May 7th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. //USER SETUP BEGINS\\
  6.  
  7. $avatarID = '123456';             //Avatar ID for items to be sent to.
  8. $whiteFile = 'whitelist.txt';     //Name and location of your accepted item list.
  9. $userName = 'admin';              //Your administration login name.
  10. $userPass = 'password';           //Your administration login password.
  11.  
  12. //USER SETUP ENDS\\
  13.  
  14. $pid = $_REQUEST['id'];
  15. $login = $_REQUEST[$userName];
  16.  
  17. $whiteHandle = fopen($whiteFile, 'r+') or die('fail');
  18. $WhiteRaw = fread($whiteHandle, filesize($whiteFile));
  19.  
  20. $whiteArray = preg_split( "/[\s,]*\\\"([^\\\"]+)\\\"[\s,]*|[\s,]+/", $whiteRaw, 0, PREG_SPLIT_DELIM_CAPTURE );
  21. $whiteCount = count($whiteArray);
  22.  
  23.  
  24.  
  25.  
  26.  
  27. if ($login == $userPass)
  28. {
  29.    //echo $BODYAdmin;
  30.    echo ('Welcome, ' . $userName . '. You have logged into the admin page. Displays $BODYAdmin HTML.');
  31. } else
  32. {
  33.  
  34.  
  35.  
  36.  
  37.  
  38. $i = 0;
  39. $isValid = 0;
  40.  
  41. while ($i <= $whiteCount)
  42. {
  43.    if ($pid == $whiteArray[$i])
  44.    {
  45.      $isValid = 1;
  46.      $i = ($whiteCount + 1);
  47.      
  48.    } else
  49.    {
  50.       $i++;
  51. }
  52.  
  53. if ($isValid == 1)
  54. {
  55.    //echo $BODYWhite;
  56.    echo ('Item ID: <i>' . $pid . '</i> is valid. Displays $BODYWhite HTML.');
  57. } else
  58. {
  59.    //echo $BODYBlack;
  60.    echo ('Invalid Item. Displays $BODYBlack HTML.');
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67. }
  68.  
  69. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement