Blank EDjok
Blank EDjok

Reputation: 742

Weird form behaviour

I have an HTML form that posts to a separate PHP file. My problem is whenever I wrap the form tags around my text input and I reload the page, my username textbox has 'localhost' as its text and the password field has my database password as its text. I honestly do not know why this happens. This is my code for my login-ui.html file:

<form action="login.php" method="post" enctype="multipart/form-data">
    <div class="login-field">
        <input type="text" name="Username" id="txtUsername" placeholder="Username" />
        <input type="password" name="Password" id="txtPassword" placeholder="Password" />
        <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="">
            <img src="pics/gears-small-white.png" style="width: 10px; height: auto;" />&nbsp;Login</a>&nbsp;&nbsp;
        <a href="#">
            <img src="pics/gears-small-white.png" style="width: 10px; height: auto;" />&nbsp;Reset Password</a>
    </div>
</form>

There is currently no code in the login.php file.

Upvotes: 0

Views: 60

Answers (2)

Jenson M John
Jenson M John

Reputation: 5689

You must have saved password in browser for that username. Try checking in different browser or change the input filed names. Also, You can just try setting autocomplete="off" on the form

 <form id="loginForm" action="login.cgi" method="post" autocomplete="off">

The easiest and simplest way to disable Form and Password storage prompts and prevent form data from being cached in session history is to use the autocomplete form element attribute with value "off".

From http://developer.mozilla.org/En/How_to_Turn_Off_Form_Autocompletion

Upvotes: 1

Shlomi Hassid
Shlomi Hassid

Reputation: 6606

Change your fields name... this is a "saved password" output. Actually you should not be worry from that... users will not get this. But just to be sure try loading the page from your cell phone or another computer and it should be empty.

Upvotes: 1

Related Questions