How can PHP be used to allow users to input a Facebook Fanpage ID and display the corresponding profile picture on a different page?
To allow users to input a Facebook Fanpage ID and display the corresponding profile picture on a different page, you can create a form where users can input the Fanpage ID. Then, use PHP to fetch the profile picture using the Facebook Graph API based on the provided ID and display it on the page.
<?php
if(isset($_POST['fanpage_id'])){
$fanpage_id = $_POST['fanpage_id'];
$url = "https://graph.facebook.com/{$fanpage_id}/picture?type=large";
$profile_picture = file_get_contents($url);
echo "<img src='{$url}' alt='Fanpage Profile Picture'>";
}
?>
<form method="post">
<label for="fanpage_id">Enter Facebook Fanpage ID:</label>
<input type="text" name="fanpage_id" id="fanpage_id">
<button type="submit">Submit</button>
</form>