0

I have a simple form like:

<form action="" method="post">
    <input type="text" name="user" id="user" class="txt" value="Account" />
    <input type="password" name="pw" id="pw" class="txt" value="Password" />
  <div class="alignleft">
    <a href="#">Forgot?</a>
  </div>
  <div class="alignright">
    <input type="submit" name="login" class="login" value="Login" />
  </div>

This form will log people into their control panel (we hold no sensitive data and we know there are better ways to login) but anyway they are not in a database, they login by simply following a URL like this:

www.example.com/user?user=USERNAME?pwrd=PASSWORD

So is the user follows that URL replacing the user and password with their own it will log them in.

How can I make my HTML form post the data to a URL and take them to the URL when they click submit?

Thanks!

1
  • You can't have 2 ? in a url query. Commented Jul 2, 2012 at 12:20

1 Answer 1

2

<form action="yoururl.com/url" method="get"> That uses a query string for the form submission.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks! so how would I append both the username and password, mid URL not just at the end?
What do you mean? In your example, they're at the end.
ah yes sorry they are at the end but there is stuff between them the actual URL looks like this: example.com/logincheck.asp?acct=USER&pwd=PASS
so how can I get the &pwd= between the username and password?
I still really have no idea what you mean. You can add additional inputs of type hidden if you want constant variables in the query string, though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.