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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:51:55+00:00 2026-05-27T05:51:55+00:00

I am creating a registration form, but I have got one problem only… why

  • 0

I am creating a registration form, but I have got one problem only… why can they pass the validation with an invalid entry? The only thing (which I know) is that they can pass it without choosing a country!

Here’s my HTML/PHP code:

<table border="0" width="100%">
    <form action="" method="post">
        <tr><td><label>Username:<span class="requiredfield">*</span></label></td><td width="200"><input type="text" name="myusername" id="myusername" maxlength="15" style="background-color:transparent;" /></td></tr>
        <tr><td><label>Summoner Name (League of Legends):<span class="requiredfield">*</span></label></td><td><input type="text" name="mysummonername" id="mysummonername" maxlength="30" /></td></tr>
        <tr><td><label>Password:<span class="requiredfield">*</span></label></td><td><input type="password" name="mypassword" id="mypassword" maxlength="15" /></td></tr>
        <tr><td><label>Retype Password:<span class="requiredfield">*</span></label></td><td><input type="password" name="myrpassword" id="myrpassword" maxlength="15" /></td></tr>
        <tr><td><label>E-mail:<span class="requiredfield">*</span></label></td><td><input type="text" name="myemail" id="myemail" maxlength="65" /></td></tr>
        <tr><td><label>Retype E-mail:<span class="requiredfield">*</span></label></td><td><input type="text" name="myremail" id="myremail" maxlength="65" /></td></tr>
        <tr><td width="300"><br />Please note that we only need this information because we'll send out prices to the winners of our tournaments.</td></tr>
        <tr><td><label>First Name:<span class="requiredfield">*</span></label></td><td><input type="text" name="myfname" id="myfname" maxlength="20" /></td></tr>
        <tr><td><label>Last Name:<span class="requiredfield">*</span></label></td><td><input type="text" name="mylname" id="mylname" maxlength="30" /></td></tr>
        <tr><td><label>Select Country:<span class="requiredfield">*</span></label></td><td><select name="mycountry" id="mycountry">
            <option value="-choose-">-Choose-</option>
            <option value="Afganistan">Afghanistan</option>
            <option value="Albania">Albania</option>
            <option value="Algeria">Algeria</option>
            ...
        </select></td></tr>
        <tr><td><label>Postal Code:</label></td><td><input type="text" name="myzipcode" id="myzipcode" maxlength="9" /></td></tr>
        <tr><td><label>City:</label></td><td><input type="text" name="mycity" id="mycity" maxlength="60" /></td></tr>
        <tr><td><label>Street:</label></td><td><input type="text" name="mystreet" id="mystreet" maxlength="50" /></td></tr>
        <tr><td><label>Telephone Number:</label></td><td><input type="text" name="myphonenumber" id="myphonenumber" maxlength="15" /></td></tr>
        <!--<tr><td><label>Invite Code<span style="color:#F00;">*</span>:</label></td><td><input type="text" name="myinvcode" id="myinvcode" /></td></tr>-->
        <!-- <tr><td colspan="2" style="height: 20px;"></td></tr> -->
        <tr><td width="300"><br />This information will be used later on when you have lost your password and need to retrieve it again.</td></tr>
        <tr><td><label>Secret Question:<span class="requiredfield">*</span></label></td><td><input type="text" name="myscrtquestion" id="myscrtquestion" maxlength="50" /></td></tr>
        <tr><td><label>Secret Answer:<span class="requiredfield">*</span></label></td><td><input type="text" name="myscrtanswer" id="myscrtanswer" maxlength="50" /></td></tr>
        <tr><td></td><td><span class="button"><input type="submit" name="submitregister" value="Register" /></span></td></tr>
        <tr><td colspan="2">By pressing "Register" you agree to the <a href='termsofuse.php'>terms of use</a> and our <a href='privacypolicy.php'>privacy policy</a>.</td></tr>
    </form>

    <?php
    if (isset($_POST['submitregister'])) {
        ob_start();
        include 'config.php'; // Connect to Database

        // Define $myusername and $mypassword 
        $myusername=$_POST['myusername'];
        $mysummonername=$_POST['mysummonername'];
        $myfname=$_POST['myfname']; 
        $mylname=$_POST['mylname']; 
        $mypassword=$_POST['mypassword'];
        $myrpassword=$_POST['myrpassword'];
        $myemail=$_POST['myemail'];
        $myremail=$_POST['myremail'];
        // $myinvcode=$_POST['myinvcode'];
        $myphonenumber=$_POST['myphonenumber'];
        $mycountry=$_POST['mycountry'];
        $myzipcode=$_POST['myzipcode'];
        $mycity=$_POST['mycity'];
        $mystreet=$_POST['mystreet'];
        $myscrtquestion=$_POST['myscrtquestion'];
        $myscrtanswer=$_POST['myscrtanswer'];

         // check to make sure required fields are entered
         if ($myusername == '' || $mysummonername == '' || $myfname == '' || $mylname == '' || $mypassword == '' || $myemail == '' || $mycountry == "-Choose-" || $myscrtquestion == '' || $myscrtanswer == '') {
            echo "<span style='color:#F00;'>Please fill in all the required fields. All the fields which are marked with a <span style='color:#0076c9;'>*</span> are required fields!</span>";

Why can you still pass this when you havn’t chosen a country? I can’t figure it out!

  • 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-27T05:51:56+00:00Added an answer on May 27, 2026 at 5:51 am

    You are checking for -Choose- however your value is -choose-.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a registration form on my school project website. I have given a
Team I'm creating an iphone application using Sencha Touch. I have registration form ,
I'm creating a user registration form and after they fill in all the information
I am creating registration form in JSF and I have field as Active, Inactive
I'm creating registration page and I've done basic client side (JS) form validation. Now
I am creating a registration form which contains two submit buttons. I need to
I have such view that handles user registration. After creating new user i want
I am creating a user registration form, and there is an option to select
I'm creating a JSF 2-application and I'm trying to use form validation in the
i am creating a registration form for that i want to implement the captcha

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.