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 7866663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:28:03+00:00 2026-06-03T00:28:03+00:00

I have a json form field which has a check box as coded :

  • 0

I have a json form field which has a check box as coded :

{"name":"Act","description":"Checkthis","type":"checkbox"}

can anyone tell me how to get this value of this check box IF it is checked using php

here is the form:

<iframe src='http://www.facebook.com/plugins/registration.php?
                    client_id=360&
                    redirect_uri=http://www.pingcampus.com/facebook_registration_plugin/store_user_data.php&
                    fields=[
                    {"name":"name"},
                    {"name":"email"},
                    {"name":"gender"},
                    {"name":"birthday"},
                    {"name":"captcha"},
                    {"name":"Act","description":"Checkthis","type":"checkbox"}
                    ]'
                    scrolling="auto"
                    frameborder="no"
                    style="border:none"
                    allowTransparency="true"
                    width="500"
                    height="600">
            </iframe>

Here is the Php code:

<?php
        define('FACEBOOK_APP_ID', '');
        define('FACEBOOK_SECRET', '');





        // No need to change function body
        function parse_signed_request($signed_request, $secret) {
            list($encoded_sig, $payload) = explode('.', $signed_request, 2);

            // decode the data
            $sig = base64_url_decode($encoded_sig);
            $data = json_decode(base64_url_decode($payload), true);

            if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
                error_log('Unknown algorithm. Expected HMAC-SHA256');
                return null;
            }


            // check sig
            $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);
            if ($sig !== $expected_sig) {
                error_log('Bad Signed JSON signature!');
                return null;
            }

            return $data;
        }

        function base64_url_decode($input) {
            return base64_decode(strtr($input, '-_', '+/'));
        }

        if ($_REQUEST) {
            $response = parse_signed_request($_REQUEST['signed_request'],
                            FACEBOOK_SECRET);
            /*
            echo "<pre>";
            print_r($response);
            echo "</pre>"; // Uncomment this for printing the response Array
            */


            echo $_POST["Act"];


            $name = $response["registration"]["name"];
            $email = $response["registration"]["email"];
            $password = $response["registration"]["password"];
            $gender = $response["registration"]["gender"];
            $dob = $response["registration"]["birthday"];
            $phone = $response["registration"]["phone"];
            $act1 = $response["registration"]["Act"];


      // Connecting to Database




            mysql_connect('', '', '') or die(mysql_error());
            mysql_select_db('pingcampus');

            $result = mysql_query("INSERT INTO usxxx set 

            name='$name',
            email='$email',

            gender='$gender',
            act='$act'
             ");
            if ($result) {

                // User successfully stored
                // Redirect to some page
            } else {
                echo mysql_error();

                // Redirect to error page
            }
        } else {
            echo '$_REQUEST is empty';
        }
        ?>
  • 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-03T00:28:05+00:00Added an answer on June 3, 2026 at 12:28 am
    <?php
    if(isset($_POST["Act"])){
      $act = $_POST["Act"];
      if(!empty($act)){
        // if Act is checked
      }
      else{
        //Act not checked
      }
    }
    ?>
    

    or add value to:

    {"name":"Act","description":"Checkthis","type":"checkbox", "value":"1"}
    

    and do so:

     <?php
        if(isset($_POST["Act"])){
          $act = $_POST["Act"];
          if($act == 1){
            // if Act is checked
          }
          else{
            //Act not checked
          }
        }
        ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form field which requires a json object as its value when
I have a bit of a conundrum. I have a form which has numerous
I have a form which on submit should see if the text area has
I am trying to parse JSON of the following form using aeson {field:{name:...}} or
If have a html form like <form method=POST action=http://.../file.php> <input type=text name=data id=data />
I have an HTML form, to which I dynamically add a text field and
I have a form for which I would like to toggle a field's required
I have a rails form, which has some fields. Now i want to send
I have a nested json. I want to post it as a form input
I have JSON string that has nested objects with dynamic names that vary each

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.