OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
facebook
/
cream
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
accessTest copy.php
601 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
accessTest.php
601 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
credential.json
556 bytes
03/03/2025 08:20:43 AM
rw-r--r--
📄
db_connect.php
341 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
function.php
11.11 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
index.php
366 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
postTest.php
1.24 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
share_facebook.php
1.66 KB
05/19/2025 10:07:15 AM
rw-r--r--
Editing: share_facebook.php
Close
<?php ini_set('display_startup_errors', 1); include 'function.php'; include 'db_connect.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/cream/share_facebook.php'; // Ensure this URL matches the one registered with Facebook if (isset($_POST['page'])) { // Handle form submission to select a page $longLivedToken = facebook_generate_long_live_token($db, $_POST['page']); echo "<a href='https://knoblycream.com/testing/cream/accessTest.php'> Test the permission</a><br>"; echo "<a href='https://knoblycream.com/testing/cream/postTest.php?'> 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($credentials); echo 'Short-Lived Access Token: ' . $shortLivedToken . '<br>'; $longLivedTokens = facebook_generate_page_tokens($db, $shortLivedToken); // Display pages for selection echo "<form method='POST' action=''>"; echo "<h3>Select a page:</h3>"; foreach ($longLivedTokens as $index => $page) { echo "<input type='radio' name='page' value='" . htmlspecialchars($page['access_token']) . "' id='page" . ($index + 1) . "'>"; echo "<label for='page" . ($index + 1) . "'>" . htmlspecialchars($page['name']) . " (Page ID: " . htmlspecialchars($page['id']) . ")</label><br>"; } echo "<input type='submit' value='Select Page'>"; echo "</form>"; } else { echo 'No code parameter found.'; }