gangsterwanster1 Posted May 26, 2009 Share Posted May 26, 2009 Whats the best way in html to store pwds /securest? (obviously not including a database) Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/ Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 html can't do any such thing. It is a markup language, not a programming language. Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842280 Share on other sites More sharing options...
gangsterwanster1 Posted May 26, 2009 Author Share Posted May 26, 2009 html can't do any such thing. It is a markup language, not a programming language. What about PHP, but without a database? Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842305 Share on other sites More sharing options...
Axeia Posted May 26, 2009 Share Posted May 26, 2009 Safest way would be to always access it via an include and locate the file itself outside of your webdirectory and do something to the passwords themselves like a salted md5 hash Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842311 Share on other sites More sharing options...
Goafer Posted May 26, 2009 Share Posted May 26, 2009 well depends how many ppl you want to be able to login. If it's just for 1-2 admin users or something you can easily store the correct username/password in a php file: <?php $user = "some"; $pass = md5("thing"); ?> or similar and the access file fopen()/include(). If it's for more people you could store in an xml file maybe and access with AJAX? Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842314 Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 html can't do any such thing. It is a markup language, not a programming language. What about PHP, but without a database? Um, this is the HTML Help board. Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842316 Share on other sites More sharing options...
gangsterwanster1 Posted May 26, 2009 Author Share Posted May 26, 2009 Safest way would be to always access it via an include and locate the file itself outside of your webdirectory and do something to the passwords themselves like a salted md5 hash Ok, i have another question. So say i make a php installer where the user picks his or her username, then the installer writes the hashed pwd in members.html, what should i do so that my code below reads members.html (where the hashes pwd / user is) and login based on those credentials? <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checklogin.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842375 Share on other sites More sharing options...
Goafer Posted May 26, 2009 Share Posted May 26, 2009 you can't with HTML, that is PHP or another programming language as pointed out before. Hence i'd suggest taking this question to the PHP help rather than HTML Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842379 Share on other sites More sharing options...
DarkSuperHero Posted May 26, 2009 Share Posted May 26, 2009 you best start reading up on some PHP tutorials... :-) It'll help you in the long run mate! and then you can post any question in the PHP Help section of the forum, where it gets more views anyways! :-) Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842445 Share on other sites More sharing options...
TheFilmGod Posted May 26, 2009 Share Posted May 26, 2009 The safest way to store passwords in an html page is to use a php session to keep the password saved, but to show ** in the html. Quote Link to comment https://forums.phpfreaks.com/topic/159696-usernamepwd-protection/#findComment-842728 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.