Created
June 29, 2019 15:56
-
-
Save ennjoy/fd43c063b596109db80f85e6b6cdd3ed to your computer and use it in GitHub Desktop.
screen_name.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$screen_name = isset($_REQUEST['screen_name']) ? secure($_REQUEST['screen_name']) : false; | |
$access_token = check_token(); | |
$result = array(); | |
if (!$screen_name) { | |
error(2, 'not found screen_name'); | |
} | |
$result = mysqli_fetch_assoc(mysqli_query($sqlConnect, "SELECT `user_id` as `object_id`, 'user' as `type` FROM ". T_USERS ." WHERE `username` = '$screen_name' UNION SELECT `page_id` as `object_id`, 'page' as `type` FROM ". T_PAGES ." WHERE `pagename` = '$screen_name' UNION SELECT `id` as `object_id`, 'group' as `type` FROM ". T_GROUPS ." WHERE `group_name` = '$screen_name'")); | |
if (!$result) { | |
error(3, 'screen_name - '.$screen_name.' is incorrect'); | |
} | |
$response = array( | |
'response' => $result | |
); | |
json_encode_cyr($response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment