We help IT Professionals succeed at work.

create a web page that asks for user name and password.

marquinez
marquinez asked
on
Medium Priority
218 Views
Last Modified: 2013-12-25
hello; I need to create a web page that validates a user name and password.  The first page should have two text boxes: one for the user name and one for the password and a button that says login.  Once the button is clicked the user name and password should be passed to a CGI script.  The script will check to see if the user name and password is located in a file.  If the user name and password are both located in a file then a page should display "Successful login".  If either the user name or password is wrong then the page should display "Unsuccessful login" and a link back to the login page. Could you help me?. Thank you.
Comment
Watch Question

why use a CGI?
each reliable web server has this functionality build-in using simple .htaccess files

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Artysystem administrator
Top Expert 2007
Commented:
marquinez:
1) Select programming language for your CGI script
2) In your form use
<FORM action="your_script_name" method="post">
Username: <input type=text name=user>
Password: <input type=password name=pass>
<INPUT type="submit" value="Send">
</FORM>
read http://www.w3.org/TR/html4/interact/forms.html more for HTML form layout
2) In your script you will get 'user' and 'pass' variables. How? It depends of your programming language.
then check them against external source and do what you want
Artysystem administrator
Top Expert 2007

Commented:
Venabili, Dushan911 also give good suggestion. And very good advice to search knowledge base before asking a question :-)
If marquinez uses Perl, these PAQs may be usefull.
Since we don't know what marquinez thinks, Dushan911 should also be included to split poiunts.

Commented:
Well..
He made an internal search and posted two links without really explaining what is on them and so on.. It won't take too much tro post some explanations as well, will it?
Dushan De SilvaTechnology Architect

Commented:
Is illegal to post internal EE PAQ links while answering questions? , which are perfectly matching quetioner's requirement

BR Dushan

Commented:
>> Is illegal to post internal EE PAQ links while answering questions? , which are perfectly matching quetioner's requirement

No :) But basically when posting ANY link, it is better to post some information what is on it... It will make the question more readable. That's all

Up to the Mods how to close
Dushan De SilvaTechnology Architect

Commented:
I agreee. Thanks!

BR Dushan
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.