Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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?

share|improve this question
8  
use form method="POST". this will send the same data but as payload and not in url. – gp. Jul 7 '14 at 15:02
    
Thank you @gp.. Answer the question so I can accept as an answer – chiapa Jul 7 '14 at 15:04

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

share|improve this answer
    
Please don't link to w3schools :( w3fools.com – redditor Jul 7 '14 at 15:05
    
Why? What's w3fools? – chiapa Jul 7 '14 at 15:06
1  
I removed it, the Microsoft one explains what you need better imo too. – Thaddius Jul 7 '14 at 15:07
    
@chiapa w3schools is significantly better than it was, even 6 months ago, but their examples are (often) poor, outdated and don't actually serve to explain the code you are working with. There are so many better places to learn. – redditor Jul 7 '14 at 15:08
    
Hmm, didn't know that. Thanks for the insight @redditor! – chiapa Jul 7 '14 at 15:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.