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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:20:49+00:00 2026-05-28T05:20:49+00:00

This script seems to get hung up when it hits the series of if

  • 0

This script seems to get hung up when it hits the series of “if” statements checking the email and password length. If I remove these statements, it properly inserts the data into the db.

<?php 

ob_start();
session_start();

if (!empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['confirmpassword'])) {

$email = strip_tags($_POST['email']);
$password = md5(strip_tags($_POST['password']));
$confirmpassword = md5(strip_tags($_POST['confirmpassword']));

$errors = array();

if (strlen($email) < 6) {
    $errors[] = "Email too short.";
}
if (strlen($email) > 25) {
    $errors[] = "Email too long.";
}
if (strlen($password) < 2) {
    $errors[] = "Password too short.";
}
if (strlen($password) > 25) {
    $errors[] = "Password too short.";
}
if ($password !== $confirmpassword) {
    $errors[] = "Passwords do not match.";
}

if (count($errors) == 0) {
    // Include database config file then connect to database
    require('db_config.php');
    $connection = mysql_connect(DB_HOST,DB_USERNAME,DB_PASSWORD) or die("Database Connection Error");
    $database = mysql_select_db(DB_NAME) or die("No Database");

    // Create query
    $query = "INSERT INTO bah_register VALUES ('','$email','$password')";

    // Query database and 
    mysql_query($query);

    // Success message
    echo "Thanks for signing up!";

} else {
    foreach ($errors as $error) {
        echo $error . "<br />";
    }
}
}

?>
  • 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-28T05:20:50+00:00Added an answer on May 28, 2026 at 5:20 am

    Your issue is that you are md5ing the password before you check the length. This puts the password at 32 characters, which is greater than your limit and producing an error.

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

Sidebar

Related Questions

This seems redundant, running perl from a Perl script itself. my $Pref = &*())(*&^%$#@!;
This script uses jsdom and jquery to get the value of an a tag's
I found this perl script here which seems will work for my purposes. It
Hey, my script seems to be getting this warning message whenever I run it.
I've tried googling this and I cant seem to find a solution/script. I want
This script saves the files as /home/name/main/all my files and stuff . I want
This script cannot find bannersize unless I write <div id=bannersize></div> before the javascript. The
This script works fine on single click but on double click it shows both
This script successfully generated the pdfs to a folder tmp/.... However the ZIP output
For this script, it checks to see if the file is a microsoft words

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.