Login Form

1

My login screen form HTML login.html ):

<form class="form-signin" method="post" action="login.php">
          <span id="reauth-email" class="reauth-email"></span>

          <input type="email" name="user" id="user" class="form-control" placeholder="Email address" required autofocus>
          <input type="password" name="password" id="password" class="form-control" placeholder="Password" required>

          <div id="remember" class="checkbox">
              <label>
                  <input type="checkbox" value="remember-me"><div class="remb">Lembrar-me</div>
              </label>
          </div>
          <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit" value="submit">Sign in</button>
</form><!-- /form -->

When I click the submit button, having typed an email and any password, the browser offers me to open a php file, when I open it, it has the code present in the file login.php . No matter what's in that file.

    
asked by anonymous 12.01.2017 / 00:40

2 answers

2
Is it like this? If it is, you are opening it the wrong way, to open it is necessary to have apache installed on your system, or open it with some program that simulates a web server (WAMP, XAMPP, EASY PHP and so on).

* OBS: Ignore the code, I got it on the internet.

    
12.01.2017 / 05:32
0

Your files need to be on some server (it may be local) that supports php. What is happening is that you are opening the .html file by the browser (right click -> open with the browser). In case the html works normal, because the browser itself has html support as well. Already with php, it is different. So it opens the file as if it were a "text file."

You can use programs like XAMPP, Vertrigo, IIS for your problem.

Another thing that can happen is that you are using a hosting service that does not support php. In this case, talk to the hosting or look for a new one.

    
12.01.2017 / 04:05