php code behaves different in Chrome and Mozilla browsers
<p>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.</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>My code for Register.php is : </p>

<pre><code>&lt;div class="signup_form"&gt;
&lt;form action="confirm.php" method="post" &gt;

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


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

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


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

&lt;/div&gt;
</code></pre>

<p>and for Confirm.php code is :</p>

<pre><code>&lt;?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) &gt; 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 '&lt;div&gt;Your account is now active. You may now &lt;a href="login.php"&gt;Log in&lt;/a&gt;&lt;/div&gt;';   
        }
    }
} ?&gt;
</code></pre>
