Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //USER SETUP BEGINS\\
- $avatarID = '123456'; //Avatar ID for items to be sent to.
- $whiteFile = 'whitelist.txt'; //Name and location of your accepted item list.
- $userName = 'admin'; //Your administration login name.
- $userPass = 'password'; //Your administration login password.
- //USER SETUP ENDS\\
- $pid = $_REQUEST['id'];
- $login = $_REQUEST[$userName];
- $whiteHandle = fopen($whiteFile, 'r+') or die('fail');
- $WhiteRaw = fread($whiteHandle, filesize($whiteFile));
- $whiteArray = preg_split( "/[\s,]*\\\"([^\\\"]+)\\\"[\s,]*|[\s,]+/", $whiteRaw, 0, PREG_SPLIT_DELIM_CAPTURE );
- $whiteCount = count($whiteArray);
- if ($login == $userPass)
- {
- //echo $BODYAdmin;
- echo ('Welcome, ' . $userName . '. You have logged into the admin page. Displays $BODYAdmin HTML.');
- } else
- {
- $i = 0;
- $isValid = 0;
- while ($i <= $whiteCount)
- {
- if ($pid == $whiteArray[$i])
- {
- $isValid = 1;
- $i = ($whiteCount + 1);
- } else
- {
- $i++;
- }
- if ($isValid == 1)
- {
- //echo $BODYWhite;
- echo ('Item ID: <i>' . $pid . '</i> is valid. Displays $BODYWhite HTML.');
- } else
- {
- //echo $BODYBlack;
- echo ('Invalid Item. Displays $BODYBlack HTML.');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement