Login Form

Asked

Viewed 196 times

1

My login screen form HTML code (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 on the Ubmit button, having typed an email and a password of any kind, 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.

  • What do you mean? The code you entered is exactly what your code looks like? I mean, this is the complete code there?

  • No, my html file has more stuff. You think I need to post the rest?

  • 1

    Put it complete, because there may be something interfering. Because apparently your code is normal

  • 2

    The php code is written on the screen as if it were a common text, that’s it?

  • You are opening your file for some program (XAMPP or WAMP)?

  • Yes, André. And no, Gilmar.

Show 1 more comment

2 answers

2

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

*NOTE: Ignore the code, I picked it up on the internet.

inserir a descrição da imagem aqui

  • Yes, it looks like this, for example. How do I install apache on my system? Recommends some tutorial?

  • 1

    Link -> https://www.youtube.com/watch?v=DH86D2gGcK8

  • 1

    @Gabrielpellegrino Web server simulator -> http://www.wampserver.com

  • 1

    https://www.apachefriends.org/pt_br/index.html

  • 1

    http://www.easyphp.org

0

Your files need to be on some server (may be local) that has php support. What is occurring is that you are opening the . html file by the browser (right button -> open with the browser). In the case of html it works normal, because the browser itself has support for html like this. Already with php, it’s different. That’s why 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, chat with the accommodation or look for a new.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.