I am tyring to have the password and username of a user that that types in appear in a file
Forum Thread: Trying to Create a .Php File That Stores User Inputs
- Hot
- Active
-
Forum Thread: How to Track Who Is Sms Bombing Me . 4 Replies
1 mo ago -
Forum Thread: Removing Pay-as-You-Go Meter on Loan Phones. 1 Replies
2 mo ago -
Forum Thread: Hydra Syntax Issue Stops After 16 Attempts 3 Replies
2 mo ago -
Forum Thread: moab5.Sh Error While Running Metasploit 17 Replies
3 mo ago -
Forum Thread: Execute Reverse PHP Shell with Metasploit 1 Replies
4 mo ago -
Forum Thread: Install Metasploit Framework in Termux No Root Needed M-Wiz Tool 1 Replies
5 mo ago -
Forum Thread: Hack and Track People's Device Constantly Using TRAPE 35 Replies
5 mo ago -
Forum Thread: When My Kali Linux Finishes Installing (It Is Ready to Boot), and When I Try to Boot It All I Get Is a Black Screen. 8 Replies
6 mo ago -
Forum Thread: HACK ANDROID with KALI USING PORT FORWARDING(portmap.io) 12 Replies
7 mo ago -
Forum Thread: Hack Instagram Account Using BruteForce 208 Replies
7 mo ago -
Forum Thread: Metasploit reverse_tcp Handler Problem 47 Replies
9 mo ago -
Forum Thread: How to Train to Be an IT Security Professional (Ethical Hacker) 22 Replies
9 mo ago -
Metasploit Error: Handler Failed to Bind 41 Replies
9 mo ago -
Forum Thread: How to Hack Android Phone Using Same Wifi 21 Replies
10 mo ago -
How to: HACK Android Device with TermuX on Android | Part #1 - Over the Internet [Ultimate Guide] 177 Replies
10 mo ago -
How to: Crack Instagram Passwords Using Instainsane 36 Replies
10 mo ago -
Forum Thread: How to Hack an Android Device Remotely, to Gain Acces to Gmail, Facebook, Twitter and More 5 Replies
10 mo ago -
Forum Thread: How Many Hackers Have Played Watch_Dogs Game Before? 13 Replies
10 mo ago -
Forum Thread: How to Hack an Android Device with Only a Ip Adress 55 Replies
11 mo ago -
How to: Sign the APK File with Embedded Payload (The Ultimate Guide) 10 Replies
11 mo ago
-
How To: Scan for Vulnerabilities on Any Website Using Nikto
-
How To: Find Vulnerable Webcams Across the Globe Using Shodan
-
How To: Crack Password-Protected Microsoft Office Files, Including Word Docs & Excel Spreadsheets
-
Hack Like a Pro: How to Find Directories in Websites Using DirBuster
-
How To: Use Kismet to Watch Wi-Fi User Activity Through Walls
-
How To: Use Burp & FoxyProxy to Easily Switch Between Proxy Settings
-
How To: Exploit EternalBlue on Windows Server with Metasploit
-
How To: Enumerate SMB with Enum4linux & Smbclient
-
How To: Phish for Social Media & Other Account Passwords with BlackEye
-
How To: Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019
-
Tutorial: Create Wordlists with Crunch
-
How To: Use SQL Injection to Run OS Commands & Get a Shell
-
How To: Unlock Facial Detection & Recognition on the Inexpensive ESP32-Based Wi-Fi Spy Camera
-
How To: Automate Wi-Fi Hacking with Wifite2
-
The Hacks of Mr. Robot: How to Hide Data in Audio Files
-
How To: Detect Script-Kiddie Wi-Fi Jamming with Wireshark
-
Hack Like a Pro: How to Hack Remote Desktop Protocol (RDP) to Snatch the Sysadmin Password
-
How To: Use Mitaka to Perform In-Browser OSINT to Identify Malware, Sketchy Sites, Shady Emails & More
-
How To: How Hackers Cover Their Tracks on an Exploited Linux Server with Shell Scripting
-
How to Hack Wi-Fi: Creating an Evil Twin Wireless Access Point to Eavesdrop on Data
1 Response
PHP is a server-side scripting language that preprocesses and manipulates HTML among other things. The PHP file itself would likely be the file for the webpage that stores the HTML, PHP, JS, CSS, etc. code.
What you would want to do is create forms in HTML, capture the form data with PHP global variables (i.e. $_POST), then still using PHP tell it to store that information in a separate file (a file that is not .php). You could go with CSV, txt, and many others. You could also have it uploaded straight into a database like MySQL. Your code for writing it to a .txt file would probably look something like this:
<form action="<?=$_SERVER['PHP_SELF'];>" method="post">
<input type="text" name="username" placeholder="username">
<br/>
<input type="password" name="password" placeholder="password">
<br/>
<input type="submit" name="submit">
</form>
<?php
if (array_key_exists("submit", $_POST)) {
$fp = "./usernames_and_passwords_list.txt";
$yourfile = fopen($fp, "a");
fwrite($yourfile, "Username: " . $POST["username"] . "\n" . "Password: " . $_POST["password"] . "\n");
fclose($yourfile);
}
?>
It's not perfect, but essentially that's what you need to capture usernames, passwords and more from PHP forms and store them in files.
If you are wanting to store user inputs from a source other than a webpage, then I would recommend learning a programming language like Python. The idea would still be the same though, get inputs which are stored in variables and then write those variables into files, using Python's syntax.
Javascript is also a possibility, but the implications are that this script is running on a browser or mobile application instead of on your server (unless you use node.js).
Share Your Thoughts