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

  • Home
  • SEARCH
  • 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 7761945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:15:56+00:00 2026-06-01T14:15:56+00:00

After reading this post on Stackoverflow Google plus popup box when hovering over thumbnail?

  • 0

After reading this post on Stackoverflow
Google plus popup box when hovering over thumbnail? I was inspirted to add it on my site.

I managed to do so and the script adds the contacts to my database. So far awesome!

However, my problem (and also appears in the example) is it does not display the “checked” value… so the user will never know if they already added them to their list or not.

Is the correct way to display checked values with PHP?

Here is my html code:

<ul style="list-style: none;padding:2px;">
<li style="padding:5px 2px;">
<input type="checkbox" id="Friends" name="circles" value="Friends" '.$checked1.'/>
            Friends
</li>
<li style="padding:5px 2px;">
<input type="checkbox" id="Following" name="circles" value="Following" '.$checked2.'/>Following
</li>
<li style="padding:5px 2px;">
<input type="checkbox" id="Family" name="circles" value="Family" '.$checked3.'/>
            Family
</li>
<li style="padding:5px 2px;">
<input type="checkbox" id="Acquaintances" name="circles" value="Acquaintances" '.$checked4.'/>
            Acquaintances
</li>
</ul>

And my PHP code is:

if($circle_check_friends>0) {
$ckecked1='checked=""';
} else if ($circle_check_following>0) {
$ckecked2='checked=""';
} else if ($circle_check_family>0) {
$ckecked3='checked=""';
} else if ($circle_check_acquaintances>0) {
$ckecked4='checked=""';
} else if ($circle_check_friends=0) {
$ckecked1='';
} else if ($circle_check_following=0) {
$ckecked2='';
} else if ($circle_check_family=0) {
$ckecked3='';
} else if ($circle_check_acquaintances=0) {
$ckecked4='';
}

Im lost because this is not giving me the result I want… i.e. for the checked values to be displayed according to the users choice.

Your help is highly appreciated

Thank you all in advance

George

  • 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-01T14:15:57+00:00Added an answer on June 1, 2026 at 2:15 pm

    Try this:

    $checked1 = ($circle_check_friends == 1) ? 'checked=""' : false;
    $checked2 = ($circle_check_following == 1) ? 'checked=""' : false;
    $checked3 = ($circle_check_family == 1) ? 'checked=""' : false;
    $checked4 = ($circle_check_acquaintances == 1) ? 'checked=""' : false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this post: using javascript to add form fields.. but below, not to
After reading this post I kinda felt in the same position as the guy
After reading and commenting on this question PHP Library for Keeping your site index
After reading this post, and the suggestion to use Team Edition for Database Professionals
After reading this post I was wondering what would be the best way to
After reading this post regarding the use ECC to implement the hashing using aa
I've tried to do this several times with no luck. After reading this post
LINQ include missing. after reading this post: http://romiller.com/2010/07/14/ef-ctp4-tips-tricks-include-with-lambda/ i would like to use include.
After reading this post i realized that i cannot pass an anonymous type as
After reading this blog post: http://www.sitepoint.com/javascript-shared-web-workers-html5/ I don't get it. What's the difference between

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.