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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:22:21+00:00 2026-05-31T21:22:21+00:00

I have a Create new account page. The form is in page named Register.php

  • 0

I have a Create new account page. The form is in page named Register.php and once user submit it, it will go to Confirm.php, where it validates the field if everything is correct shows the ” Account Created ” Message.

In Chrome. The error message is shown in Register.php and once all
fields are filled then only will show confirm.php. But in Mozilla, it
goes to Confirm.php and shows a blank page.

My code for Register.php is :

<div class="signup_form">
<form action="confirm.php" method="post" >

<?php 
    session_start();
    if(isset($_SESSION['error']))
    {
        echo '<p>'.$_SESSION['error']['username'].'</p>';
        echo '<p>'.$_SESSION['error']['email'].'</p>';
        echo '<p>'.$_SESSION['error']['password'].'</p>';
        unset($_SESSION['error']);
    }
?>


<p>
<font size="3" face="arial" color="gray"> <label for="username"><b> UserName*</b> </label> </font>
<input name="username" type="text" id="username" input style="height:33px" size = "50" size="30"/>

</p>
<p>
<font size="3" face="arial" color="gray"> <label for="email"><b> E-mail Address*</b> </label> </font>
<input name="email" type="text" id="email"  input style="height:33px" size = "50" size="30"/>
</p>


<p>
<font size="3" face="arial" color="gray"> <label for="password"><b> Password*</b> </label> </font>
<input name="password" type="password" id="password"   input style="height:33px" size = "50" size="30"/>
    </p>  
<p>
<input name="submit" type="image" src="images/submit.gif" value="submit"/>    </p>
</form>

</div>

and for Confirm.php code is :

<?php
    session_start();
    include('configdb.php');

    if(isset($_POST['submit']))
    {
        if($_POST['username'] == '')
        {

            $_SESSION['error']['username'] = "User Name is required.";
        }
        if($_POST['email'] == '')
        {
            $_SESSION['error']['email'] = "E-mail is required.";
        }
            else
            {
                if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['email']))
                {
                    $email= $_POST['email'];
                    $sql1 = "SELECT * FROM user WHERE email = '$email'";
                    $result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error($mysqli));
                    if (mysqli_num_rows($result1) > 0) {
                        $_SESSION['error']['email'] = "This Email is already used.";
                    }
                }
                else
                {
                $_SESSION['error']['email'] = "Your email is not valid.";
                }
            }
        if($_POST['password'] == '')
        {
            $_SESSION['error']['password'] = "Password is required.";
        }

        if(isset($_SESSION['error']))
        {
            header("Location: register.php");
            exit;
        }
        else
        {
            $username = $_POST['username'];
            $email = $_POST['email'];
            $password = $_POST['password'];

            $sql2 = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$password')";
            $result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error());

            if($result2)
            {

            echo '<div>Your account is now active. You may now <a href="login.php">Log in</a></div>';   
        }
    }
} ?>
  • 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-31T21:22:22+00:00Added an answer on May 31, 2026 at 9:22 pm

    Using if(isset($_POST['submit'])) combined with an input type="image" does not work as expected, because the browser should send submit.x and submit.y with the coordinates the image was clicked on.

    Instead, try using if($_POST) to ensure the form was submitted, or maybe isset($_POST['username']) or some other field you KNOW the name of.

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

Sidebar

Related Questions

I have a (HTTPS) login.php page which remains HTTPS (ie once user logged in
I have a PHP script where I create a new process using proc_open().It executes
I have a general create function that submits a new user to the database
In my JSF file I have below at the start. <h:form><h:commandLink value=Create New Staff
I have a RegisterModel view model I use for my new account registration page.
Hey guys bit of a complication here, I have a create account page and
I want to have a registration page and a create account page. After filling
So I have a subscription form where a user is simultaneously creating a new
I have a form where a user logs in with a google account and
I have to create new Report from existing report in SQL Server Reporting service,

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.