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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:44:24+00:00 2026-06-13T02:44:24+00:00

I have checks in here and if something happens, it will echo a phrase

  • 0

I have “checks” in here and if something happens, it will echo a phrase like The username you supplied is already in use or whatever. When it DOES display it though, it’ll only display it on a blank page with that text. What is wrong here?

PHP

<?php
    include('./dbconnect/global.php');

    if ($_POST['register']) {
        $username = mysql_real_escape_string(strip_tags($_POST['username']));
        $password = mysql_real_escape_string(strip_tags($_POST['password']));
        $email = mysql_real_escape_string(strip_tags($_POST['email']));

        if (!$username||!$password||!$email)
            echo "PLease Fill in The Required Fields";
        else {
            //check if username is taken
            $check = mysql_query("SELECT * FROM users WHERE username='$username'");
            if (mysql_num_rows($check) >= 1)
                echo "The Username you Supplied Is Already in Use! <a href='./register'>Back</a>";
            $check2 = mysql_query("SELECT * FROM users WHERE email='$email'");
            if (mysql_num_rows($check) >= 1)
                echo "The Email you Supplied Is Already in Use! <a href='./register'>Back</a>";
            else {
                $password2 = md5($password);
                $register = mysql_query("value and stuff)") or die(mysql_error());
                echo "Thanks for registering, $username! <a href='./index'>Home</a>";
            }
        }
    }

    else {
?>

HTML

<html>

<head>

    <title>CoreCrafters</title>
    <link rel="stylesheet" type="text/css" href="./css/main.css">

</head>

<body>

    <?php include('./include/nbar.php') ?>

    <div id="main">

        <div id="register">
            <div id="wrapper">
                <form action="register" method="POST">
                    Username
                    <br />
                    <input type="username" name="username">
                    <br />
                    Password
                    <br />
                    <input type="password" name="password">
                    <br />
                    Email
                    <br />
                    <input type="email" name="email">
                    <br /><br />
                    <input type="submit" name="register" value="Register">
                </form>
            </div>
        </div>

    </div>

    <?php include('./include/footer.php') ?>

</body>

</html>

Ending PHP (From ELSE at end)

<?php
    }
?>

CSS

body {
    margin: 0;
    padding: 0;
    background-color: #EEE;
}

#headerbar {
    width: 100%;
    background-color: #000;
}

a {
    color: #069;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s linear;
    -o-transition: all 0.2s linear;
    -ms-transition: all 0.2s linear;
    -moz-transition: all 0.2s linear;
    -webkit-transition: all 0.2s linear;
}

a:hover { 
    color: #c00;
}

#nav {
    padding: 0;
    width: 100%;
    float: left;
    list-style: none;
    margin: 0 0 3em 0;
    background-color: #f2f2f2;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc; 
}

#nav li {
    float: left;
}

#nav li a {
    color: #069;
    display: block;
    font-weight: bold;
    padding: 8px 15px;
    text-decoration: none;
    transition: all 0.2s linear;
    border-right: 1px solid #ccc;
    -o-transition: all 0.2s linear;
    -ms-transition: all 0.2s linear;
    -moz-transition: all 0.2s linear;
    -webkit-transition: all 0.2s linear;
}

#nav li a:hover {
    color: #c00;
    background-color: #fff;
}

#footer {
    width: 94%;
    padding: 10px;
    margin-top: 10px;
    margin-left: auto;
    padding-left: 0px;
    text-align: center;
    margin-right: auto;
    padding-right: 0px;
    border: 1px solid #DDD;
    background-color: #FFF;
}

#main {
    width: 94%;
    margin-top: 50px;
    min-height: 500px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #DDD;
    background-color: #FFF;
}

#register {
    width: 15%;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background-color: #CCC;
    border: 1px solid #AAA;
}

#logbar {
    width: 150px;
    float: right;
    min-height: 36px;
    padding-left: 5px;
    padding-right: 50px;
    background-color: #DDD;
}

As requested, I posted most of the page onto here.

  • 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-13T02:44:26+00:00Added an answer on June 13, 2026 at 2:44 am

    Your webpage has no content except that echo, so it is echo-ing it on a blank page because you told it to.

    • Update: Code

      <!DOCTYPE html>
      <html class="no-js">
      <head>
          <meta charset="utf-8"> <!-- UXSS UTF-7 (IE6) prevention -->
          <title>CoreCrafters</title>
          <link rel="stylesheet" type="text/css" href="./css/main.css">
      </head>
      <body>
      <?php @include('./include/nbar.php'); ?>
      <div id="main">
          <div id="register">
              <div id="wrapper">
                  <form method="POST">
                      Username<br /><input type="username" name="username"><br />
                      Password<br /><input type="password" name="password"><br />
                      Email<br /><input type="email" name="email"><br /><br />
                      <input type="submit" name="register" value="Register">
                  </form>
              </div>
      <?php
      @include('./dbconnect/global.php');
      
      if (isset($_POST['register'])) {
          if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['email'])) {
              die('Please fill out the required fields.');
          } else {
              $query = mysql_query("SELECT * FROM users WHERE username = '" . mysql_real_escape_string($_POST['username']) . "'");
              if (mysql_num_rows($query)) { die('The username you provided is already in use!'); }
      
              $query = mysql_query("SELECT * FROM users WHERE email = '" . mysql_real_escape_string($_POST['email']) . "'");
              if (mysql_num_rows($query)) { die('The email you provided is already in use!'); }
      
              /** Insert values **/
      
              echo 'Thanks for registering, ' . htmlentities($_POST['username'], ENT_QUOTES) . '!'; /** Normal XSS prevention **/
         }
      }
      ?>
          </div>
      </div>
      <?php @include('./include/footer.php'); ?>
      </body>
      </html>
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project I would like to have compile time checks on my existing
I have a script that checks something on my PC every 5 minutes and
I have a simple server that looks something like this: void *run_thread(void *arg) {
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have
I have the middleware that allows me to check user auth, here is: function
I have two arrays: $array1 = array(1=>1,10=>1,12=>0,13=>13); $array2 = array(1=>Hello,10=>Test,12=>check,13=>error); Here $array1 has keys
I need to know if all the client-side validator checks have succeeded, or if
I currently have form that checks if a user has unsubmitted changes when they
I have this regex that checks for a 5 digit number ^\d{5}$ How do
I have a function which checks the passed value and returns false or true,

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.