Hi,
Need some help please, relatively new to php and i'm creating a table from a database of passwords. I've already created an input form to add usernames and passwords into the database, its the output to a table that i'm struggling with.
The table displays all the usernames and passwords alphabetically which works perfectly, what I want to add is the password to be displayed as asterisks and on hover it displays the password. Can someone please help and advise the best way with a little bit of guidance to do this.
thanks in advance.
Password Table
Moderators: egami, macek, gesf
-
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
You don't need to see your users passwords ever.
Its not for the users accounts, its for a database to store the logins for access to all the tools we use. Just some people are not allowed to access them and if the screen is open on a users desktop id rather the passwords were not viewable by passers by.
-
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
Because you're wanting to manipulate the page based on user interaction, you're not going to be able to do it with php. Personally, I think JQuery is the best way to go. One second and I'll whip up a little example.
*** edit ***
example code added
Code: Select all
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("input[type='password']").hover(function(){
$("#showme").toggle("fast");
});
$("input").blur(function(){
$(this).removeAttr("type");
});
});
</script>
</head>
<body>
<table>
<tr>
<td>
<label for="un">Username</blah>
</td>
<td>
<input type="text" value="Ima User" />
</td>
</tr>
<tr>
<td>
<label for="pw" >Password</blah>
</td>
<td>
<input type="password" value="Password" />
<input id="showme" type="text" value="Password" style="display:none;" />
</td>
</tr>
</table>
</body>
</html>
example code added