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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:42:24+00:00 2026-06-08T08:42:24+00:00

I’m working on a registration form for my website. One of the fields on

  • 0

I’m working on a registration form for my website.

One of the fields on my registration form is a drop down box that is populated by a table on my MySQL database.

I originally wrote the registration script a different way but I needed to change how the form worked to accommodate the new drop down box and the way it gathered its data.

Before the changes the form was successfully submitted, but now it just gives me a white screen.

I have checked the mysqli_connect.php with an if-else statement. It showed that it was working but no registrations were being sent to the MySQL server when the submit button was pressed. Also, the drop down box was not showing any of the content from the MySQL table that it was linked to.

Below is a copy of the script that I am using:

<?php
@ini_set('display_errors', 'on');
echo "<h1>Register</h1>";

if ($_SERVER['REQUEST_METHOD'] == 'POST'){
  $errors = array();
  if (empty($_POST['firstname'])){
    $errors[] = 'Your forgot to enter your first name.';
  }else{
    $firstname = trim($_POST['firstname']);
  }
  if (empty($_POST['lastname'])){
    $errors[] = 'Your forgot to enter your last name.';
  }else{
    $lastname = trim($_POST['lastname']);
  }
  if (empty($_POST['username'])){
    $errors[] = 'Your forgot to enter your  username.';
  }else{
    $username = trim($_POST['username']);
  }
  if (!empty($_POST['password1'])) {
    if ($_POST['password1'] != $_POST ['password2']) {
      $errors[] = 'Your password did not match the confirmed password!';
    }else{
      $password = trim($_POST['password1']);
    }
  } else {
    $errors[] = 'You forgot to enter your password!';
  }
  if (empty($_POST['birthdate'])){
    $errors[] = 'Your forgot to enter your  birthdate.';
  }else{
    $birthdate = trim($_POST['birthdate']);
  }
  if (empty($_POST['gamespyid'])){
    $errors[] = 'Your forgot to enter your  gamespy id.';
  }else{
    $gamespyid = trim($_POST['gamespyid']);
  }
  if (empty($errors)) {
    require ('mysqli_connect.php');
    $q="INSERT INTO Users (firstname, lastname, username, password1, birthdate, gamespyid, base) VALUES ('$firstname', '$lastname', '$username', SHA1('$password1'), '$birthdate', '$gamespyid', '$base')";
    $r = @mysql_query($dbc, $q);
    if ($r){
      echo'<p>You are now registered</p>';
    }else{
      echo'<p>You have not been registered</p>';
    }
  } else {
    echo 'Error<br> <p>The following errors have occured:<br/>';
    foreach ($error as $msg) {
      echo " - $msg<br/>\n";
    }
    echo '</p><p>Please try again.</p><p><br/></p>';
  }   //if no errors
}     //submit
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
  <title></title>
</head>

<body>
  <form action="../pages/register.inc.php" method='POST'>
    <table summary="REgform">
      <tr>
        <td>First Name:</td>

        <td><input type='text' name='firstname' value='<?php echo $firstname; ?>'></td>
      </tr>

      <tr>
        <td>Last Name:</td>

        <td><input type='text' name='lastname'value='<?php echo $lastname; ?>'></td>
      </tr>

      <tr>
        <td>Username:</td>

        <td><input type='text' name='username'value='<?php echo $username; ?>'></td>
      </tr>

      <tr>
        <td>Password:</td>

        <td><input type='password' name='password1'></td>
      </tr>

      <tr>
        <td>Repeat Password:</td>

        <td><input type='password' name='password2'></td>
      </tr>

      <tr>
        <td>Birthdate:</td>

        <td><input type='text  ' name='birthdate'value='<?php echo $birthdate; ?>'></td>
      </tr>

      <tr>
        <td>Gamespy Id:</td>

        <td><input type='text' name='gamespyid'value='<?php echo $gamespyid; ?>'></td>
      </tr>

      <tr>
        <td>Base:</td>

       <td><select name="base" size="1">
          <option>
            Select One
          </option>
         <?php  require('http://www.virtual-aviation.org/gatewayaviation/admin/mysqli_connect.php');
         $q = "SELECT  id, CONCAT_WS(' ', airport_name, airport_code) FROM airports ORDER BY airport_code ASC";
         $r = mysqli_query ($dbc, $q);
         if (mysqli_num_rows($r) > 0) {
         while ($row = mysql_fetch_array ($r, MYSQL_NUM)) {
         echo "<option value=\"$row[0]\"";
         if (isset($_POST['existing']) && ($_POST['existing'] == $row[0]) ) echo 'selected="selected"'; echo ">$row[1]</option>\n";
         }
   } else {
   echo '<option>Please a new airport first.</optioon>';
    }
    mysqli_close($dbc);
         ?>
        </select></td>
      </tr>
    </table>

    <p><input type='submit' name='submit' value='Register'></p>
  </form>
</body>
</html>

Errors found in the dropdown box area
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home5/virtua15/public_html/gatewayaviation/pages/register.inc.php on line 178

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home5/virtua15/public_html/gatewayaviation/pages/register.inc.php on line 180
Please a new airport first.

  • 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-08T08:42:25+00:00Added an answer on June 8, 2026 at 8:42 am

    You can’t require from ‘http’. You need to change

    require('http://www.virtual-aviation.org/gatewayaviation/admin/mysqli_connect.php');
    

    to some local path like

    require('mysqli_connect.php');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into

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.