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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:42:23+00:00 2026-05-17T15:42:23+00:00

I am using an MySQL table with the following structure: `login` ( `loginid` int(11)

  • 0

I am using an MySQL table with the following structure:

`login` (
  `loginid` int(11) unsigned NOT NULL auto_increment,
  `username` varchar(30) NOT NULL,
  `password` varchar(50) NOT NULL,
  `email` varchar(255) NOT NULL,
  `actcode` varchar(45) NOT NULL,
  `disabled` tinyint(1) NOT NULL default '0',
  `activated` tinyint(1) NOT NULL default '0',
  `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `points` bigint(9) NOT NULL,
  `website` varchar(1000) NOT NULL,
  `location` varchar(1000) NOT NULL,
  `age` varchar(1000) NOT NULL,
  `gender` varchar(1000) NOT NULL,
  `subcheckr` tinyint(1) NOT NULL,
  PRIMARY KEY  (`loginid`)
)

I have several fields that the user can fill out while registering. They all work fine (the information is transmitted to the database). I also have a checkbox for a user to select while registering. However, when a user selects the check box, the value “1” is not being transmitted to the database. The checkbox has the name of “subcheckr” in both the code below and the database.

Any idea why the checkbox is not working?

Thanks in advance,

John

When a user registers, I am using the following code:

function show_registration_form(){

    echo '<form action="http://www...com/.../register.php" method="post">  

    <div class="register"><label for="username">Select Username:</label></div> 
    <div class="registerform"><input name="username" type="text" id="username" maxlength="30"></div>

    <div class="passwordregister"><label for="password">Select Password:</label></div> 
    <div class="passwordregisterform"><input name="password" type="password" id="password" maxlength="15"></div>

    <div class="passwordregister2"><label for="password2">Re-type password:</label></div> 
    <div class="passwordregister2form"><input name="password2" type="password" id="password2" maxlength="15"></div>

    <div class="emailregister"><label for="email">Your Email (required):</label></div> 
    <div class="emailregisterform"><input name="email" type="text" id="email" maxlength="255"></div> 


    <div class="websiteregister"><label for="website">Your Website (optional):</label></div> 
    <div class="websiteregisterform"><input name="website" type="text" id="website" maxlength="255"></div> 

    <div class="locationregister"><label for="website">Your Location (optional):</label></div> 
    <div class="locationregisterform"><input name="location" type="text" id="location" maxlength="255"></div>

    <div class="ageregister"><label for="website">Your Age (optional):</label></div> 
    <div class="ageregisterform"><input name="age" type="text" id="age" maxlength="255"></div>

    <div class="genderregister"><label for="website">Your Gender (optional):</label></div> 
    <div class="genderregisterform"><input name="gender" type="text" id="gender" maxlength="255"></div>

    <div class="subcheckr"><INPUT TYPE=CHECKBOX NAME="subcheckr">Click here to receive updates via email (optional).<P></div>

    <p class="registerbutton"> 
    <input name="register" type="submit" value="Register"> 
    </p> 

    </form>';

}

The following code is on the page register.php:

if (isset($_POST['register'])){

    if (registerNewUser($_POST['username'], $_POST['password'], $_POST['password2'], $_POST['email'], $_POST['website'], $_POST['location'], $_POST['age'], $_POST['gender'], $_POST['subcheckr'])){


        echo '<div class="submittitle">Thank you for registering, an email has been sent to your inbox, Please activate your account.</div>';


    }else {

        echo '<div class="submittitler">There was a problem with your registration.  Perhaps the username or email you picked was already in use.  Please try again.</div>';
        show_registration_form();

    }

} else {
// has not pressed the register button
    show_registration_form();   
}

Here is the new registration function:

function registerNewUser($username, $password, $password2, $email, $website, $location, $age, $gender, $subcheckr)
{

    global $seed;

    if (!valid_username($username) || !valid_password($password) || 
            !valid_email($email) || $password != $password2 || user_exists($username) || email_exists($email))
    {
        return false;
    }


    $code = generate_code(20);
    $sql = sprintf("insert into login (username,password,email,actcode, website, location, age, gender, subcheckr) value ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
        mysql_real_escape_string($username), mysql_real_escape_string(sha1($password . $seed))
        , mysql_real_escape_string($email), mysql_real_escape_string($code), mysql_real_escape_string($website), mysql_real_escape_string($location),               mysql_real_escape_string($age), mysql_real_escape_string($gender), mysql_real_escape_string($subcheckr));


    if (mysql_query($sql))
    {
        $id = mysql_insert_id();

        if (sendActivationEmail($username, $password, $id, $email, $code))
        {

            return true;
        } else
        {
            return false;
        }

    } else
    {
        return false;
    }
    return false;

}
  • 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-05-17T15:42:24+00:00Added an answer on May 17, 2026 at 3:42 pm

    replace this line:

    <INPUT TYPE=CHECKBOX NAME="subcheckr">
    

    with:

    <INPUT TYPE=CHECKBOX NAME="subcheckr" value="1">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my MySQL database, I have a table with structure username - varchar insert_time
I have a login arraylist where i have stored users loginid using following mysql
Using MySQL syntax and having a table with a row like: mydate DATETIME NULL,
I have the following MySQL table fields: description1 , description2 , description3 : Varchar(500)
So I'm using PHP/MySQL and I have a tbl_profile table with the following fields:
For example, mysql quote table name using SELECT * FROM `table_name`; notice the `
When using phpMyAdmin or the MySQL GUI Tools, whenever I create an InnoDB table,
I am using ruby on rails with a MySQL backend. I have a table
So, I'm using jdbc to talk to a MySQL DB. For many a table
I have created a mysql table with the following columns... item_price, discount, delivery_charge, grand_total

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.