Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $x="";
- if(isset($_GET['btn'])){
- $user = $_GET['user'];
- $pass = $_GET['pass'];
- /*
- echo $user."<br>";
- echo $pass."<br>";*/
- $x=verificalogin($user,$pass);
- }
- function verificalogin($user, $pass){
- if($user == "andre" && $pass == "abc123"){
- return 'Sucesso';
- }else{
- return 'Erro';
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- </head>
- <body>
- <form action="formulario.php" method="GET">
- <input type="text" name="user">
- <input type="pass" name="pass">
- <input type="submit" name="btn">
- </form>
- <?php
- if($x=="Erro"){
- echo "login invalido";
- }else{
- echo "OK";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement