Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide form input fields from URL

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?

like image 518
chiapa Avatar asked Jul 07 '14 15:07

chiapa


1 Answers

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

like image 190
Thaddius Avatar answered Oct 22 '22 08:10

Thaddius