Hi to all
this code work well but i want that password appear in asterisk..

<SCRIPT language="JavaScript"><!--
function check() {
    // Prompt user for the password ...
    pwd = prompt('Enter password before continuing','');
    // ... then set the browser location. (change the line below this one!)
if(pwd=="sidra")
{
    location.href = 'showfile.php';}
}
// -->
</SCRIPT>
<HTML>
<HEAD>
<img src="idtech_logo.jpg" alt="logo" width="1500" height="80" />
//<TITLE>Site Entrance</TITLE>
</HEAD>
<CENTER><h1>User Requests</br></br></h1>
</CENTER>
<BODY  bgcolor="#1E90FF">

<DIV align="center">You must have a password to view the user requests!<P>
    <FORM>
        <INPUT type="Button" onClick="check()" value="Enter Password">
    </FORM>
</DIV>
</BODY>
</HTML>

please help me

Recommended Answers

All 5 Replies

Member Avatar for stbuchok

You can't do it using prompt.

here is the way

<input type="password" placeholder="enter password" />

You do understand that javascript is clientside, so anyone who wants to find your password can 'view source' and read the password stored in clear text
at the very least hash the password and send only the hash value

Airshow's security rule no 1 : only ever send passwords from client-to-server, never from server-to-client.

Airshow

just include <input type = "password" placeholder = "Enter your password gere"> in the <form> tag

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.