Hello people
I'm a new python user and i don't know much about it.
The thing I have to do is make a simple log in with one valid username and password. When those two are done, the submit button should link this file to the next one. Don't know how to do that
my file looks like this so far:
#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
print 'Content-type: text/html\n\n'
print '''<html>
<head>
<title>private bibliotek</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#0066CC">
<p> </p><table width="46%" height="66" border="0" align="center">
<tr>
<td><h1><strong>PRIVAT BIBLIOTEK</strong></h1></td>
</tr>
</table>
<table width="49%" border="0" align="center">
<tr>
<td width="41%"><font color="#000000"><strong>User:</strong> </font> <input type="text" name="Name" size="10" maxlength="40">
</td>
<td width="59%"><strong><font color="#000000">Password:</font></strong> <input type="password" name="password" size="10" maxlength="10">
</td>
</tr>
</table>
<table width="12%" height="75" border="0" align="center">
<tr>
<td height="45"><font color="#000000"><em>
<input type="submit" name="Submit" value="Log in here">
</em></font></td>
</tr>
<tr>
<td height="24"><font color="#000000"><em><u>Ny bruger </u></em></font></td>
</tr>
'''
import cgi
form = cgi.FieldStorage()
username = form.getvalue('Name','')
password = form.getvalue('password','')
if username == 'user' and password =='1234':
## here i have to add that on click to submit button -> open next page
## otherwise return alert box
print '''
</table>
</body>
</html> '''
Thank you for your help
I'm a new python user and i don't know much about it.
The thing I have to do is make a simple log in with one valid username and password. When those two are done, the submit button should link this file to the next one. Don't know how to do that
my file looks like this so far:
#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
print 'Content-type: text/html\n\n'
print '''<html>
<head>
<title>private bibliotek</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#0066CC">
<p> </p><table width="46%" height="66" border="0" align="center">
<tr>
<td><h1><strong>PRIVAT BIBLIOTEK</strong></h1></td>
</tr>
</table>
<table width="49%" border="0" align="center">
<tr>
<td width="41%"><font color="#000000"><strong>User:</strong> </font> <input type="text" name="Name" size="10" maxlength="40">
</td>
<td width="59%"><strong><font color="#000000">Password:</font></strong> <input type="password" name="password" size="10" maxlength="10">
</td>
</tr>
</table>
<table width="12%" height="75" border="0" align="center">
<tr>
<td height="45"><font color="#000000"><em>
<input type="submit" name="Submit" value="Log in here">
</em></font></td>
</tr>
<tr>
<td height="24"><font color="#000000"><em><u>Ny bruger </u></em></font></td>
</tr>
'''
import cgi
form = cgi.FieldStorage()
username = form.getvalue('Name','')
password = form.getvalue('password','')
if username == 'user' and password =='1234':
## here i have to add that on click to submit button -> open next page
## otherwise return alert box
print '''
</table>
</body>
</html> '''
Thank you for your help