Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
- <link rel="stylesheet" type="text/css" href="css/index.css" />
- <title>Cadastro de Clientes</title>
- <link rel="stylesheet" href="css/jquery.mobile-1.1.2.min.css" />
- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
- </head>
- <body>
- <center>
- <p><img src="img/agrocultivo_02.jpg" width="300" height="95" /></p>
- <form id="formAcesso" method="post" name="formAcesso">
- <p>E-mail:
- <br />
- <input type="text" name="email" id="email" value="agrocultivo"/>
- </p>
- <p>Senha:<br />
- <input type="password" name="senha" id="senha" value="agrocultivo"/>
- </p>
- <button type="submit" id="click" onClick="acessar()"><span>Acessar</span></button>
- </p>
- </form>
- </center>
- </body>
- </html>
- <script>
- function acessar() {
- var form = $("#formAcesso").serialize();
- alert(form);
- $.ajax({
- type: 'POST',
- url: 'http://www.agrocultivo.com.br/pedidos/phonegap/acesso.php',
- crossDomain: true,
- data: form,
- dataType: 'json',
- async: false,
- success: function (response){
- //alert ("response");
- if (response.success) {
- alert("Logado");
- window.location = "area.html";
- }
- else {
- alert("Login Falhou");
- //window.location("main.html");
- }
- },
- error: function(error){
- //alert(response.success);
- alert('Sem conexão ao banco de dados: ' + error);
- window.location = "index.html";
- }
- });
- return false;
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement