Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Password Table

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Password Table

Postby jonnyphp » 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.
jonnyphp
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Jun 05, 2012 7:31 am

Re: Password Table

Postby seandisanti » Mon Oct 15, 2012 8:31 am

You don't need to see your users passwords ever.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Password Table

Postby jonnyphp » 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.
jonnyphp
New php-forum User
New php-forum User
 
Posts: 6
Joined: Tue Jun 05, 2012 7:31 am

Re: Password Table

Postby seandisanti » 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
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron