0

Morning guys hope your well, at the moment I'm creating a regsiter and log in page for my website. When I load the page on my local host, the page does not show and all that does show is my nav bar. Can anyone give me a hint as to where I'm going wrong please?

This is my code so far

<!DOCTYPE html>
<html>
    <head>
        <title>Richard Hemmings  </title>
        <meta name="viewpoint" content="width=device-width, intail-scale=1.0">
        <link href = "css/bootstrap.min.css"rel = "stylesheet">
        <link href = "css/stylesheet.css" rel = "stlesheet">
    </head>
    <body>
        <div class = "navbar navbar-inverse navbar-static-top">
            <div class = "contrainer">
<?php
include('inc/header.php');
require('connection_db.php'); 
if(isset($_POST ['submit'])){
   // Peform the berification of the nation 

   $email1 = $_POST['email1']; 
   $email2 = $_POST['email2']; 
   $pass1 = $_POST['pass1']; 
   $pass2 = $_POST['pass2']; 

   if($email1 == $email2) {
        if($pass1 == $pass2) {
        }else{ 
                echo "sorry, your passwords do not match. <br />"; 
                exit(); 
        }
         echo "Sorry your email's do not match, please try again<br /><";
   }else{ 

       echo $form =   <<<EOT
                <form action='register.php' method="POST">
                    First Name: <input type="text" name="name" /><br />
                    Last Name: <input type="text" name="lname" /><br />
                    Username: <input type="text" name="uname" /><br />
                    Email: <input type="text" name="email1" /><br />
                    Confirm Email: <imput type="text" name="email2" /><br />
                    Password: <input type="password" name"pass1" /><br />
                    Confirm Password <input type="password" name="pass2" /><br />
                    <input type="submit" value="Register" name="Submit" /><br />
EOT;
//echo $form;
// the preceding line must have NO leading white-space of any kind
}
}
?>










        <div class = "navbar navbar-default navbar-fixed-bottom"> 

                <div class = "container"> 
                    <P class = "navbar-text">Site build and belongs to Richard Hemmings (C) 2015</P> 

                </div> 

                </div>








       <script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src = "js/bootstrap/js" ></script>




        </body>

        </html> 

Any help would be great

Richard

2
Contributors
4
Replies
10
Views
2 Years
Discussion Span
Last Post by lps
1

This line of code if(isset($_POST ['submit'])) check and run the script inside if only if the value of $_POST ['submit'] is set. But based on the current codes provided, there is no form posted the field value with name 'submit' to it. I think what you wish to is something liek this:

<!DOCTYPE html>
<html>
    <head>
        <title>Richard Hemmings  </title>
        <meta name="viewpoint" content="width=device-width, intail-scale=1.0">
        <link href = "css/bootstrap.min.css"rel = "stylesheet">
        <link href = "css/stylesheet.css" rel = "stlesheet">
    </head>
    <body>
        <div class = "navbar navbar-inverse navbar-static-top">
            <div class = "contrainer">
<?php

if(isset($_POST ['submit'])){
   // Peform the berification of the nation 
   $email1 = $_POST['email1']; 
   $email2 = $_POST['email2']; 
   $pass1 = $_POST['pass1']; 
   $pass2 = $_POST['pass2']; 
   if($email1 == $email2) {
        if($pass1 == $pass2) {
        }else{ 
                echo "sorry, your passwords do not match. <br />"; 
                exit(); 
        }
    }else{
        echo "Sorry your email's do not match, please try again<br /><";
    }
}else{ 
       echo $form =   <<<EOT
                <form action='register.php' method="POST">
                    First Name: <input type="text" name="name" /><br />
                    Last Name: <input type="text" name="lname" /><br />
                    Username: <input type="text" name="uname" /><br />
                    Email: <input type="text" name="email1" /><br />
                    Confirm Email: <imput type="text" name="email2" /><br />
                    Password: <input type="password" name"pass1" /><br />
                    Confirm Password <input type="password" name="pass2" /><br />
                    <input type="submit" value="Register" name="Submit" /><br />
EOT;
//echo $form;
// the preceding line must have NO leading white-space of any kind
}
?>
        <div class = "navbar navbar-default navbar-fixed-bottom"> 
                <div class = "container"> 
                    <P class = "navbar-text">Site build and belongs to Richard Hemmings (C) 2015</P> 
                </div> 
                </div>
       <script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src = "js/bootstrap/js" ></script>
        </body>
        </html> 

The problem is that you miss put your curly brackets.

Edited by lps

0

brillaint it works thank you so much for the speedy replay. Only thing is The form is now shwoing in the nav bar! All I will have to do it just move the nav bar php to the top of the page. Also did you move the require database line too? as I cant seem to find that

0

Ignore last post I have sorted it! Once again thank you so muchh for your help! I can now get on with the rest of the tutorial to get it working

0

Glad that I can be of help and please do mark the thread as 'solved' if the problem solved. Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.