OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
social_media
/
facebook
/
bin
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
accessTest.php
608 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
fb_share.php
8.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--
📄
new_table.php
13.36 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--
📄
sample_data.txt
7.07 KB
12/26/2024 08:39:28 AM
rw-r--r--
📄
share_facebook.php
1.93 KB
05/19/2025 10:07:13 AM
rw-r--r--
Editing: share_facebook.php
Close
<?php ini_set('display_startup_errors', 1); include 'function.php'; include 'db_connect.php'; include '../inc/validate.logged.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'; // Ensure this URL matches the one registered with Facebook if (isset($_POST['page_token']) && $_POST['page_id']) { // Handle form submission to select a page $longLivedToken = facebook_generate_long_live_token($db, $_POST['page_id'], $_POST['page_token']); echo "<a href='https://knoblycream.com/testing/accessTest.php'> Test the permission</a><br>"; echo "<a href='https://knoblycream.com/testing/postTest.php?pageId=".$_POST['page_id']."'> Test Sending the Post to Facebook</a>"; } // Check if there's a code parameter in the query string else if (isset($_GET['code'])) { $shortLivedToken = facebook_generate_short_live_code($db, $credentials); echo 'Short-Lived Access Token: ' . $shortLivedToken . '<br>'; $pageTokens = facebook_generate_page_tokens($db, $shortLivedToken); // Display pages for selection echo "<form method='POST' action=''>"; echo "<h3>Select a page:</h3>"; foreach ($pageTokens as $index => $page) { echo "<input type='radio' name='page_token' value='" . htmlspecialchars($page['access_token']) . "' id='page" . ($index + 1) . "'>"; echo "<label for='page" . ($index + 1) . "'>" . htmlspecialchars($page['name']) . " (Page ID: " . htmlspecialchars($page['id']) . ")</label>"; // Add a hidden input for the page ID echo "<input type='hidden' name='page_id' value='" . htmlspecialchars($page['id']) . "'>"; echo "<br>"; } echo "<input type='submit' value='Select Page'>"; echo "</form>"; } else { echo 'No code parameter found.'; }