Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:21:09+00:00 2026-06-17T09:21:09+00:00

I am working on a college website. I’m using a Facebook plugin to show

  • 0

I am working on a college website. I’m using a Facebook plugin to show the likes of a Facebook page by using this:

<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpcclahore&amp;width=364&amp;height=220&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color&amp;header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:364px; height:220px;" allowTransparency="true"></iframe>

The problem is that Facebook is blocked on the college servers, so nothing appears except a warning. Is it possible to show a static image instead of Facebook plugin while the internet not available (localhost) or Facebook not accessible? Like this:

if(Facebook accessible)
show Facebook pluging
else
<img src="images/fb.jpg" width="364" height="220">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:21:09+00:00Added an answer on June 17, 2026 at 9:21 am
    // check if local server is HTTPS if so check Facebook HTTPS
    $remote = ('80' !== $_SERVER['SERVER_PORT'])
        ? array('host' => 'ssl://www.facebook.com', 'port' => 443)  // HTTPS Facebook
        : array('host' => 'www.facebook.com', 'port' => 80);        // HTTP Facebook
    
    $fp = @ fsockopen($remote['host'], $remote['port'], $errno, $errstr, 5);
    
    echo (!$fp) // check if failed
        ? '<img src="images/fb.jpg" width="364" height="220">' // output local image
        : '<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpcclahore&amp;width=364&amp;height=220&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color&amp;header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:364px; height:220px;" allowTransparency="true"></iframe>'; // output IFRAME
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a website for my church's college group, and am started
I'm working on a website where I need to show/hide table rows. I got
I am working for my college website . I wrote a php script ,that
I am working on a project for a local college using MVC3. I have
I'm working this programming task for college where we have to write a c++
I am working on an assignment for a college assembly class. We are using
I'm working on making a redesign of my college newspaper's website and got the
I'm working on my College project and I keep getting this exception when I
Ok, I'm working on a php college project, and I have to let students
since monday, i'm working as an intern in a company (final year at college)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.