7

I've got a login form with two input fields: username and password.

<form method="get" action="../Main/Index">
    <p>
        <input type="text" name="username" value="" placeholder="username" maxlength="30"></p>
    <p>
        <input type="password" name="password" value="" placeholder="password" maxlength="25"></p>

    <p class="submit">
        <input type="submit" name="commit" value="Enter">
    </p>

</form>

Once the user submits the form, his username and password are shown in the browser's URL textbox, something like this:

http://localhost:53997/Main/Index?username=zm&password=123456789&commit=Enter

I don't want his username and password to be on display.

How can I do this?

2
  • 9
    use form method="POST". this will send the same data but as payload and not in url.
    – gp.
    Commented Jul 7, 2014 at 15:02
  • Thank you @gp.. Answer the question so I can accept as an answer
    – chiapa
    Commented Jul 7, 2014 at 15:04

1 Answer 1

10

the problem is that youre using form method = "get" when you should be using form method = "post" instead.

this explains it:

http://msdn.microsoft.com/en-us/library/ee784233(v=cs.20).aspx

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.