OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
testing
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/04/2025 08:32:49 AM
rwxr-xr-x
📄
accessTest copy.php
601 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
accessTest.php
601 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📁
backup
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
composer-setup.php
57.04 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
composer.json
64 bytes
03/03/2025 08:18:54 AM
rw-r--r--
📄
composer.lock
2.81 KB
03/03/2025 08:18:54 AM
rw-r--r--
📄
composer.phar
2.86 MB
03/03/2025 08:18:55 AM
rw-r--r--
📄
configuration.txt
79 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📁
cream
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
credential copy.json
556 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
credential.json
556 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
db_connect.php
341 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
function.php
18.87 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
get_facebook_access_token.php
1.94 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
index.php
420 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
navbar.php
1.63 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
new_folder
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
new_index.php
10.03 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
permissionTest.php
1.26 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
postTest.php
3.38 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
post_to_page.php
2.23 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
share_facebook.php
1.96 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
sidebar.php
3.08 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
update_fb_pages.php
347 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📁
vendor
-
05/19/2025 10:07:13 AM
rwxr-xr-x
Editing: get_facebook_access_token.php
Close
<?php // Facebook App credentials $credentials = json_decode(file_get_contents('credential.json'), true); $appId = $credentials['app_id']; $appSecret = $credentials['appSecret']; $redirectUri = 'https://knoblycream.com/testing/share_facebook.php'; // Replace with your redirect URI // Authorization endpoint $dialogUrl = 'https://www.facebook.com/v12.0/dialog/oauth'; $params = [ 'client_id' => $appId, 'redirect_uri' => $redirectUri, 'scope' => 'publish_actions', // Permissions requested 'response_type' => 'code', ]; // Redirect user to Facebook for authentication $authUrl = $dialogUrl . '?' . http_build_query($params); header('Location: ' . $authUrl); exit(); // After user grants permission, Facebook redirects back with 'code' parameter in the URL // Handle the callback (e.g., in your redirect URI file) if (isset($_GET['code'])) { // Exchange 'code' for access token $tokenUrl = 'https://graph.facebook.com/v12.0/oauth/access_token'; $tokenParams = [ 'client_id' => $appId, 'client_secret' => $appSecret, 'redirect_uri' => $redirectUri, 'code' => $_GET['code'], ]; // Initialize cURL session $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $tokenUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($tokenParams)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute cURL request $response = curl_exec($ch); // Check for errors if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { // Decode JSON response $responseData = json_decode($response, true); if (isset($responseData['access_token'])) { echo 'Access Token: ' . $responseData['access_token']; } else { echo 'Error in obtaining access token.'; } } // Close cURL session curl_close($ch); } ?>