Até então eu uso um frame onde fica meu painel
Como faço pra adaptar minha pagina para usar essa forma de Post??
PS. Não encontrei nada aqui na busca do fórum
Link do Tuto:
http://www.plugmaste...-com-AJAX-e-PHP
Minha função do Ajax:
http://www.mxstudio....a-div-com-ajax/
painel/logon.php
<?php session_destroy(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Autenticação de Usuário</title> <style type="text/css"> .style135794 { text-align: center; } .style135798 { font-family: Verdana; } .style135801 { font-weight: bold; } .style135804 { font-family: Verdana; text-align: left; } .style135805 { font-family: Verdana; font-size: xx-small; } .style135806 { font-size: x-small; } .style135807 { font-family: Verdana; text-align: center; } .style2556892 { font-size: xx-small; } .style3556892 { font-family: Verdana; font-size: xx-small; } .style7556892 { color: #808080; } .style10556892 { color: #424242; } .style5 { font-family: Verdana; font-size: xx-small; text-align: right; } </style> </head> <body style="margin: 0; "> <div class="style135794"> <form action="acessa.php" name="autenticacao" method="post" style="height: 86px; width: 184px;" class="style135805"> <table style="float: left; width: 35px;"> <td width="50" class="style135804"><strong>Login:</strong></td> <td class="style135804" style="width: 135px"> <input type="text" name="login" size="16" maxlength="16" class="style135801" style="width: 135px" /></td> </tr> <tr> <td class="style135804"><strong>Senha:</strong></td> <td class="style135804" style="width: 135px"><strong> <input type="password" name="senha" size="16" maxlength="10" style="width: 135px" /></strong></td> </tr> <tr> <td colspan="2" class="style135807"> <font SIZE="2" class="style2556892"> <strong> <span class="style3556892"> <span class="style7556892"><span class="style10556892"> <input type="image" value="Acessar" class="style5" src="../images_old/loginBT.png" name="submit"/></span></span></span></strong></td> </tr> </table> </form> </div> </body> </html>
painel/acessa.php
<?php header("Content-Type: text/html; charset=ISO-8859-1",true); require_once("ctracker.php"); include("cnn.php"); session_start(); // Recupera o login $login = isset($_POST["login"]) ? addslashes(trim($_POST["login"])) : FALSE; // Recupera a senha $senha = isset($_POST["senha"]) ? addslashes(trim($_POST["senha"])) : FALSE; // Usuário não forneceu a senha ou o login if(!$login || !$senha) { echo "Nossa bola de cristal está com defeito! Digite seu login e senha para que possamos saber quem é você!<br>Erro: AR000X0P0<meta http-equiv='refresh' content='5;URL=logon.php'>"; exit(); }; $resultado = mysql_query("SELECT * FROM login WHERE userid = '".$login."'"); $linhas=mysql_num_rows($resultado); $dados=mysql_fetch_array($resultado); if($linhas==0) // testa se a consulta retornou algum registro { echo "Login invalido! <br>Erro: AR000X0P1<meta http-equiv='refresh' content='5;URL=logon.php'>"; exit; } if($linhas>0) { if ($senha != mysql_result($resultado, 0, "user_pass")) // confere senha { echo "Login ou senha invalidos! <br>Erro: AR000X0P2<meta http-equiv='refresh' content='5;URL=logon.php'>"; exit; } else // usuario e senha corretos. vamos criar cookies { $_SESSION["id"] = $dados["account_id"]; $_SESSION["user"] = $dados["userid"]; $who = $dados['userid']; header("Location: cp.php"); exit; } } ?>