Password Table

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
jonnyphp
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Jun 05, 2012 7:31 am

Sun Oct 14, 2012 8:01 am

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.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Mon Oct 15, 2012 8:31 am

You don't need to see your users passwords ever.

jonnyphp
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Jun 05, 2012 7:31 am

Tue Oct 16, 2012 12:45 am

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.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Tue Oct 16, 2012 7:24 am

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.

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>


*** edit ***
example code added

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests