· 6 years ago · Apr 26, 2020, 02:36 AM
1$api_dev_key = 'YOUR API DEVELOPER KEY';
2$api_user_name = 'a_users_username';
3$api_user_password = 'a_users_password';
4$api_user_name = urlencode($api_user_name);
5$api_user_password = urlencode($api_user_password);
6$url = 'https://pastebin.com/api/api_login.php';
7$ch = curl_init($url);
8
9curl_setopt($ch, CURLOPT_POST, true);
10curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_dev_key='.$api_dev_key.'&api_user_name='.$api_user_name.'&api_user_password='.$api_user_password.'');
11curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
12curl_setopt($ch, CURLOPT_VERBOSE, 1);
13curl_setopt($ch, CURLOPT_NOBODY, 0);
14
15$response = curl_exec($ch);
16echo $response;