Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 10-16-2006, 01:49 PM   #1
Baseband Member
Join Date: May 2005
Posts: 63
Default create a simple login in cgi with no database

hi folks,

I'm trying to create a simple log in. And here what i got so far:

def check_login():
    pwd = { 'user':    'password',
            'game':    'blivit',
    if form.has.key(user) and form.has.key(password):
        print "You are now logged in"
        print "Invalid username or password"

def form1():
   print """    
    <FORM ACTION="assign5.cgi" METHOD="POST">
    <P><FONT SIZE="5" COLOR="#990000">Login</FONT><BR>

    <TABLE BORDER="0" WIDTH="271">
    <TD WIDTH="48%">
        <P ALIGN="RIGHT">Username:
    <TD WIDTH="1%">&nbsp;</TD>
    <TD WIDTH="51%"><INPUT TYPE="TEXT" NAME="username" SIZE="12"></TD>
        <TD WIDTH="48%">
            <P ALIGN="RIGHT">Password:
        <TD WIDTH="1%">&nbsp;</TD>
        <TD WIDTH="51%"><INPUT TYPE="PASSWORD" NAME="password" SIZE="12"></TD>
        <TD WIDTH="48%">&nbsp;</TD>
        <TD WIDTH="1%">&nbsp;</TD>
        <TD WIDTH="51%"><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"><INPUT TYPE="RESET" NAME="Reset" VALUE="Clear"></TD>
form = cgi.FieldStorage()
when i put this script on my site, it shows the log in form(user and password), but when i put user name and password in and click button "Log in" then it does not work.

I don't know what i have done wrong. Any idea ? thanks
v_xxx_v is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 11:44 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0