Posts
$accessToken);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
return json_decode($result, true);
}
// Handle form submission
if ($_POST['submit']) {
$token = trim($_POST['token']);
$postId = trim($_POST['post_id']);
if (empty($token) || empty($postId)) {
$_SESSION['error'] = 'Please provide both token and post ID.';
} else {
// Basic validation (add more checks)
if (!preg_match('/^EAAC/', $token)) { // Rough token check
$_SESSION['error'] = 'Invalid access token format.';
} else {
…