473,574 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with CGI functions on python.

8 New Member
Hi all....

i'm very new to this programming language. i'm required to fulfill this task in the company i'm doing my practical. i hope i can get guide for my problem...
Here is the script i already wrote but i'm having problem to move forward.

#!C:\python24\p ython.exe

####Code for viewing database....or search function#######

print 'Content-type: text/html\n\n'

import cgi # importing cgi module

import MySQLdb #importing MySQLdb module

form = cgi.FieldStorag e() #assigning form to the cgi.FieldStorag e

attribute = form.getvalue(" attribute") #assigning attribute to get value from the function called attribute(drop down box) in the form

search = form.getvalue(" search") #assigning search to get value from the function called search(textbox) in the form

conn =MySQLdb.connec t(host = 'localhost', db='LESS', user ='root', passwd='') #creating conn to connect to MySQL

curs = conn.cursor() #creating a cursor called curs

curs.execute("u se LESS") # exucuting the database

table = "download_f ile" #assignin table to download_file which is retrieved from MySql "less" under tables
#(download_file is a table name in less)

query = "select * from %s where %s like '%s'" %(table, attribute, search) #assigin query to MySQL command of select

#print query
curs.execute(qu ery) #executing command set in the query function

count = curs.rowcount #indicating the cursor to count the rows
######## start of HTML code ##########
page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml
<head><title>Vi ew Database</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet " href="http://localhost/Pictures/mm_travel2.css" type="text/css" />

<style type="text/css">
<!--
.style1 {font-family: Georgia}
.style2 {font-family: "Franklin Gothic Medium"}
.style3 {
font-family: "Franklin Gothic Medium";
font-weight: bold;
font-size: x-small;
font-style: italic;
}
.style4 {font-family: Georgia; font-size: 12px; }
.style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
.style6 {
font-size: large;
font-family: "Comic Sans MS";
font-style: italic;
font-weight: bold;
}
.style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
.style8 {font-family: "Times New Roman"; color: #000000; }
.style9 {
font-family: Arial;
font-weight: bold;
}
.style10 {
font-family: Roman;
font-size: 18px;
}
.style11 {color: #000000}
.style12 {
font-family: "Times New Roman";
font-style: italic;
}
.style13 {color: #000000; font-family: "Courier New"; }
.style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
.style15 {color: #006699;
font-weight: bold;
}
.style16 {color: #006699; font-weight: bold; font-size: 16px; }
-->
</style>

<script language="JavaS cript" type="text/javascript">

var d=new Date();
var monthname=new Array("January" ,"February","Ma rch","April","M ay","June","Jul y","August","Se ptember","Octob er","November", "December") ;
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() ;
</script>
</head>
<body bgcolor="#C0DFF D">
<span class="style15" ><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
<h1 align="center">
<script language="JavaS cript1.2">
var message="LESS File Collection!"
var neonbasecolor=" #99FF66"
var neontextcolor=" #CC3399"
var flashspeed=100 //in milliseconds
var n=0
if (document.all|| document.getEle mentById){
document.write( '<font color="'+neonba secolor+'">')
for (m=0;m<message. length;m++)
document.write( '<span id="neonlight'+ m+'">'+message. charAt(m)+'</span>')
document.write( '</font>')
}
else
document.write( message)
function crossref(number ){
var crossobj=docume nt.all? eval("document. all.neonlight"+ number) : document.getEle mentById("neonl ight"+number)
return crossobj
}
function neon(){
if (n==0){
for (m=0;m<message. length;m++)
crossref(m).sty le.color=neonba secolor
}
crossref(n).sty le.color=neonte xtcolor
if (n<message.leng th-1)
n++
else{
n=0
clearInterval(f lashing)
setTimeout("beg inneon()",1500)
return
}
}
function beginneon(){
if (document.all|| document.getEle mentById)
flashing=setInt erval("neon()", flashspeed)
}
beginneon()
</script>

<table width="104%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td colspan="4" bgcolor="#00336 6"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#CCFF9 9">
<td>&nbsp;</td>
<td colspan="3" id="dateformat " height="25"><a href="LESS.html ">HOME</a> ::<a href="Collectio n.html">Collect ion</a> ::<a href="Info.html ">Info</a> ::<a href="Sources.h tml">Sources</a> :: <script language="JavaS cript" type="text/javascript">
document.write( TODAY); </script> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#00336 6"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td width="4">&nbsp ;</td>
<td colspan="2" valign="top"><p >&nbsp;</p>
<p>&nbsp;</p></td>
<td width="590">&nb sp; </td>
</tr>
</table>
'''
print page
print "<p><div align=\"center\ "><h1>Searc h with %s Results</h1>" %count
print "<i>Searchi ng for %s with %s</i> </div></p>" %(attribute, search)
print "<form method=post action=http://localhost/cgi-bin/Raulf/next.py>"
print "<table border = 1 cellpadding =0 cellspacing = 0>"
##### End of HTML code ######

###### start of Html and python code for the header of the search table #######
print "<tr bgcolor=\"#cccc cc\">"
print "<td></td>"

h = 0 #setting the values of the attribute as zero

while h < 9: # total attribute is 0-8 so while h is less than 9
desc = curs.descriptio n[h]
print "<th>%s</th>" %desc[0]
h += 1 #increase the h value.
print "</tr>"
print "<p align=right><in put type=submit value=Download> &nbsp; <input type=submit value=Delete></p>"

###### End of code #####

###### start of Html and python code for the result of the search table #######

no_of_rows = 0 #setting the number of rows as zero



while True: #using while for true

row = curs.fetchone() #asking cursor to fetch one data at a time for a row
if not row: break #saying if its not a row the break it.

if (no_of_rows % 2): # for even no of row
print "<tr bgcolor=\"#dfdf df\">" # if code is even, use such color for the cell
print "<td><input type=checkbox name=tick value=",form["attribute"].value=='d_id', "></td>"
i = 0
while i < 9:
print "<td>%s</td>" %row[i]
i += 1
else:
print "<td><input type=checkbox name=tick value=", form["attribute"].value=='d_id', "></td>"
i = 0
while i < 9:
print "<td>%s</td>" %row[i]
i += 1
no_of_rows += 1
print "</tr>"
print "</table>"

print "<div align = \"center\">< a href=\"http://localhost/Raulf/show_all.html\" >Back</a>"
print "<input type=submit value=Submit>"
print "</form></body></html>"
my problem is :

1. how do i assign each checkbox to have equal value with the value of the d_id?

2. when the checkbox is clicked or check and when the submit button is pressed, how can i produce a new page showin me all the d_id of the check box that is clicked?

3. this is somethin like email function. when the checkbox is checked and delete button is pressed, how do i remove the checked files from my database?

4. finally if the checked box is checked and the download button is pressed, how do i download that particular file into the assignned folder, in this case assignned folder is C:\temp. If multiple box are checked, the file should be zipped and download in the assignned folder. how could i reach to this?

please assist me to this. i also will attach a snapshot.

Actually the codes above is a cgi for this codes:
<html>
<head>
<title>Source Downloader for LESS
</title>
<body>
<div align="left"><h 1>Find record in LESS</h1></div>
<form method="POST" action="http://localhost/cgi-bin/Raulf/show_all.py">
<p>Select:
<select name ="attribute" >
<option value="d_id">Fi le ID</option>
<option value="filename ">Filename</option>
<option value="extensio n">Extension </option>
<option value="size">Si ze(Bytes)</option>
<option value="url">Dow nloaded from</option>
<option value="location ">Location in LESS</option>
<option value="md5">MD5 </option>
<option value="SHA1">SH A1</option>
<option value="time_add ">Date Entered</option>
</select>
<input type= text name="search">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</body>
</html>

very sorry. i'm extremely new to this and i have to complete this asap. can pls help me with the codes? thanks
Jan 15 '07 #1
3 3001
ghostdog74
511 Recognized Expert Contributor
hi

can you put your code in "code" tags, not "quote" tags.
thanks
Jan 15 '07 #2
cuties
8 New Member
sorry abt tat error....

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Source Downloader for LESS
  4. </title>
  5. <body>
  6. <div align="left"><h1>Find record in LESS</h1></div>
  7. <form method="POST" action="http://localhost/cgi-bin/Raulf/show_all.py">
  8. <p>Select:
  9. <select name ="attribute">
  10. <option value="d_id">File ID</option>
  11. <option value="filename">Filename</option>
  12. <option value="extension">Extension</option>
  13. <option value="size">Size(Bytes)</option>
  14. <option value="url">Downloaded from</option>
  15. <option value="location">Location in LESS</option>
  16. <option value="md5">MD5</option>
  17. <option value="SHA1">SHA1</option>
  18. <option value="time_add">Date Entered</option>
  19. </select>
  20. <input type= text name="search">
  21. <br>
  22. <input type="submit" value="Submit">
  23. <input type="reset" value="Reset">
  24. </body>
  25. </html>
Expand|Select|Wrap|Line Numbers
  1. #!C:\python24\python.exe
  2.  
  3. ####Code for viewing database....or search function#######
  4.  
  5. print 'Content-type: text/html\n\n'
  6.  
  7. import cgi # importing cgi module
  8.  
  9. import MySQLdb #importing MySQLdb module
  10.  
  11. form = cgi.FieldStorage() #assigning form to the cgi.FieldStorage
  12.  
  13. attribute = form.getvalue("attribute") #assigning attribute to get value from the function called attribute(drop down box) in the form
  14.  
  15. search = form.getvalue("search") #assigning search to get value from the function called search(textbox) in the form
  16.  
  17. conn =MySQLdb.connect(host = 'localhost', db='LESS', user ='root', passwd='') #creating conn to connect to MySQL
  18.  
  19. curs = conn.cursor() #creating a cursor called curs
  20.  
  21. curs.execute("use LESS") # exucuting the database
  22.  
  23. table = "download_file" #assignin table to download_file which is retrieved from MySql "less" under tables
  24. #(download_file is a table name in less)
  25.  
  26. query = "select * from %s where %s like '%s'" %(table, attribute, search) #assigin query to MySQL command of select
  27.  
  28. #print query
  29. curs.execute(query) #executing command set in the query function
  30.  
  31. count = curs.rowcount #indicating the cursor to count the rows
  32. ######## start of HTML code ##########
  33. page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  34. <html xmlns="http://www.w3.org/1999/xhtml
  35. <head><title>View Database</title>
  36.  
  37. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  38. <link rel="stylesheet" href="http://localhost/Pictures/mm_travel2.css" type="text/css" />
  39.  
  40. <style type="text/css">
  41. <!--
  42. .style1 {font-family: Georgia}
  43. .style2 {font-family: "Franklin Gothic Medium"}
  44. .style3 {
  45. font-family: "Franklin Gothic Medium";
  46. font-weight: bold;
  47. font-size: x-small;
  48. font-style: italic;
  49. }
  50. .style4 {font-family: Georgia; font-size: 12px; }
  51. .style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
  52. .style6 {
  53. font-size: large;
  54. font-family: "Comic Sans MS";
  55. font-style: italic;
  56. font-weight: bold;
  57. }
  58. .style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
  59. .style8 {font-family: "Times New Roman"; color: #000000; }
  60. .style9 {
  61. font-family: Arial;
  62. font-weight: bold;
  63. }
  64. .style10 {
  65. font-family: Roman;
  66. font-size: 18px;
  67. }
  68. .style11 {color: #000000}
  69. .style12 {
  70. font-family: "Times New Roman";
  71. font-style: italic;
  72. }
  73. .style13 {color: #000000; font-family: "Courier New"; }
  74. .style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
  75. .style15 {color: #006699;
  76. font-weight: bold;
  77. }
  78. .style16 {color: #006699; font-weight: bold; font-size: 16px; }
  79. -->
  80. </style>
  81.  
  82. <script language="JavaScript" type="text/javascript">
  83.  
  84. var d=new Date();
  85. var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  86. var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
  87. </script>
  88. </head>
  89. <body bgcolor="#C0DFFD">
  90. <span class="style15"><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
  91. <h1 align="center">
  92. <script language="JavaScript1.2">
  93. var message="LESS File Collection!"
  94. var neonbasecolor="#99FF66"
  95. var neontextcolor="#CC3399"
  96. var flashspeed=100 //in milliseconds
  97. var n=0
  98. if (document.all||document.getElementById){
  99. document.write('<font color="'+neonbasecolor+'">')
  100. for (m=0;m<message.length;m++)
  101. document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
  102. document.write('</font>')
  103. }
  104. else
  105. document.write(message)
  106. function crossref(number){
  107. var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
  108. return crossobj
  109. }
  110. function neon(){
  111. if (n==0){
  112. for (m=0;m<message.length;m++)
  113. crossref(m).style.color=neonbasecolor
  114. }
  115. crossref(n).style.color=neontextcolor
  116. if (n<message.length-1)
  117. n++
  118. else{
  119. n=0
  120. clearInterval(flashing)
  121. setTimeout("beginneon()",1500)
  122. return
  123. }
  124. }
  125. function beginneon(){
  126. if (document.all||document.getElementById)
  127. flashing=setInterval("neon()",flashspeed)
  128. }
  129. beginneon()
  130. </script>
  131.  
  132. <table width="104%" border="0" cellspacing="0" cellpadding="0">
  133. <tr>
  134. <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  135. </tr>
  136.  
  137. <tr bgcolor="#CCFF99">
  138. <td>&nbsp;</td>
  139. <td colspan="3" id="dateformat" height="25"><a href="LESS.html">HOME</a> ::<a href="Collection.html">Collection</a> ::<a href="Info.html">Info</a> ::<a href="Sources.html">Sources</a> :: <script language="JavaScript" type="text/javascript">
  140. document.write(TODAY); </script> </td>
  141. </tr>
  142. <tr>
  143. <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  144. </tr>
  145. <tr>
  146. <td width="4">&nbsp;</td>
  147. <td colspan="2" valign="top"><p>&nbsp;</p>
  148. <p>&nbsp;</p></td>
  149. <td width="590">&nbsp; </td>
  150. </tr>
  151. </table>
  152. '''
  153. print page
  154. print "<p><div align=\"center\"><h1>Search with %s Results</h1>" %count
  155. print "<i>Searching for %s with %s</i> </div></p>" %(attribute, search)
  156. print "<form method=post action=http://localhost/cgi-bin/Raulf/next.py>"
  157. print "<table border = 1 cellpadding =0 cellspacing = 0>"
  158. ##### End of HTML code ######
  159.  
  160. ###### start of Html and python code for the header of the search table #######
  161. print "<tr bgcolor=\"#cccccc\">"
  162. print "<td></td>"
  163.  
  164. h = 0 #setting the values of the attribute as zero
  165.  
  166. while h < 9: # total attribute is 0-8 so while h is less than 9
  167. desc = curs.description[h]
  168. print "<th>%s</th>" %desc[0]
  169. h += 1 #increase the h value.
  170. print "</tr>"
  171. print "<p align=right><input type=submit value=Download>&nbsp; <input type=submit value=Delete></p>"
  172.  
  173. ###### End of code #####
  174.  
  175. ###### start of Html and python code for the result of the search table #######
  176.  
  177. no_of_rows = 0 #setting the number of rows as zero
  178.  
  179.  
  180.  
  181. while True: #using while for true
  182.  
  183. row = curs.fetchone() #asking cursor to fetch one data at a time for a row
  184. if not row: break #saying if its not a row the break it.
  185.  
  186. if (no_of_rows % 2): # for even no of row
  187. print "<tr bgcolor=\"#dfdfdf\">" # if code is even, use such color for the cell
  188. print "<td><input type=checkbox name=tick value=",form["attribute"].value=='d_id', "></td>"
  189. i = 0
  190. while i < 9:
  191. print "<td>%s</td>" %row[i]
  192. i += 1
  193. else:
  194. print "<td><input type=checkbox name=tick value=", form["attribute"].value=='d_id', "></td>"
  195. i = 0
  196. while i < 9:
  197. print "<td>%s</td>" %row[i]
  198. i += 1
  199. no_of_rows += 1
  200. print "</tr>"
  201. print "</table>"
  202.  
  203. print "<div align = \"center\"><a href=\"http://localhost/Raulf/show_all.html\">Back</a>"
  204. print "<input type=submit value=Submit>"
  205. print "</form></body></html>"
  206.  
Jan 15 '07 #3
cuties
8 New Member
sorry for the error i caused. earlier i also said that i'll attach a snapshot but i'm not available to do it. anyway my question is something like how our email system works. Only extra tasks is der such as user can view results of all the checked output. for question no2 i did try writing a script but i jst don't get the results that i desire. here is the codes

Expand|Select|Wrap|Line Numbers
  1. #!C:\python24\python.exe
  2.  
  3. print 'Content-type: text/html\n\n'
  4.  
  5. import cgi
  6.  
  7. import MySQLdb  
  8.  
  9. form = cgi.FieldStorage() 
  10.  
  11. tick = form.getvalue("tick")
  12.  
  13. attribute = form.getvalue("attribute") 
  14.  
  15. search = form.getvalue("search") 
  16.  
  17. conn =MySQLdb.connect(host = 'localhost', db='LESS', user ='root', passwd='') 
  18.  
  19. curs = conn.cursor() 
  20.  
  21. curs.execute("use LESS")  
  22.  
  23. page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml
  25. <head><title>Results of Checked Output</title>
  26.  
  27. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  28. <link rel="stylesheet" href="http://localhost/Pictures/mm_travel2.css" type="text/css" />
  29.  
  30. <style type="text/css">
  31. <!--
  32. .style1 {font-family: Georgia}
  33. .style2 {font-family: "Franklin Gothic Medium"}
  34. .style3 {
  35.     font-family: "Franklin Gothic Medium";
  36.     font-weight: bold;
  37.     font-size: x-small;
  38.     font-style: italic;
  39. }
  40. .style4 {font-family: Georgia; font-size: 12px; }
  41. .style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
  42. .style6 {
  43.     font-size: large;
  44.     font-family: "Comic Sans MS";
  45.     font-style: italic;
  46.     font-weight: bold;
  47. }
  48. .style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
  49. .style8 {font-family: "Times New Roman"; color: #000000; }
  50. .style9 {
  51.     font-family: Arial;
  52.     font-weight: bold;
  53. }
  54. .style10 {
  55.     font-family: Roman;
  56.     font-size: 18px;
  57. }
  58. .style11 {color: #000000}
  59. .style12 {
  60.     font-family: "Times New Roman";
  61.     font-style: italic;
  62. }
  63. .style13 {color: #000000; font-family: "Courier New"; }
  64. .style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
  65. .style15 {color: #006699;
  66.     font-weight: bold;
  67. }
  68. .style16 {color: #006699; font-weight: bold; font-size: 16px; }
  69. -->
  70. </style>
  71.  
  72. <script language="JavaScript" type="text/javascript">
  73.  
  74. var d=new Date();
  75. var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  76. var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
  77. </script>
  78. </head>
  79. <body bgcolor="#C0DFFD">
  80. <span class="style15"><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
  81. <h1 align="center">
  82. <script language="JavaScript1.2">
  83. var message="LESS File Collection!"
  84. var neonbasecolor="#99FF66"
  85. var neontextcolor="#CC3399"
  86. var flashspeed=100  //in milliseconds
  87. var n=0
  88. if (document.all||document.getElementById){
  89. document.write('<font color="'+neonbasecolor+'">')
  90. for (m=0;m<message.length;m++)
  91. document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
  92. document.write('</font>')
  93. }
  94. else
  95. document.write(message)
  96. function crossref(number){
  97. var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
  98. return crossobj
  99. }
  100. function neon(){
  101. if (n==0){
  102. for (m=0;m<message.length;m++)
  103. crossref(m).style.color=neonbasecolor
  104. }
  105. crossref(n).style.color=neontextcolor
  106. if (n<message.length-1)
  107. n++
  108. else{
  109. n=0
  110. clearInterval(flashing)
  111. setTimeout("beginneon()",1500)
  112. return
  113. }
  114. }
  115. function beginneon(){
  116. if (document.all||document.getElementById)
  117. flashing=setInterval("neon()",flashspeed)
  118. }
  119. beginneon()
  120. </script>
  121.  
  122. <table width="104%" border="0" cellspacing="0" cellpadding="0">
  123.   <tr>
  124.     <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  125.   </tr>
  126.  
  127.   <tr bgcolor="#CCFF99">
  128.       <td>&nbsp;</td>
  129.       <td colspan="3" id="dateformat" height="25"><a href="LESS.html">HOME</a> ::<a href="Collection.html">Collection</a> ::<a href="Info.html">Info</a> ::<a href="Sources.html">Sources</a> :: <script language="JavaScript" type="text/javascript">
  130.       document.write(TODAY);    </script>    </td>
  131.   </tr>
  132.  <tr>
  133.     <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  134.   </tr>
  135.  <tr>
  136.     <td width="4">&nbsp;</td>
  137.     <td colspan="2" valign="top"><p>&nbsp;</p>
  138.     <p>&nbsp;</p></td>
  139.       <td width="590">&nbsp; </td>
  140.   </tr>
  141. </table>
  142. '''
  143. print page
  144.  
  145. if tick == True:
  146.     print "The d_id", form["tick"].value, "is checked" 
  147. else: 
  148.     print "Nothing is ticked"
  149.  
  150.  
  151.  
  152. print "</body></html>"
  153.  
  154.  
Jan 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1677
by: sinisam | last post by:
Object oriented programming is not a new term to me, but when I tried to do some of it... uhh... it sure looked (and felt) like Hell :) I won't bother about things like "help me learn it" (but wouldn't mind if someone recommends a good fresh-start tutorial), instead I'll ask for help... I did my share of programming several years ago... 6...
99
5862
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less important changes, so in this thread I would like to focus on that issue alone. I have edited the Proposed Syntax example below to take out the...
0
1261
by: Neal D. Becker | last post by:
I'm using boost::python to transform various C++ classes and functions to python. It is all working quite well, but now I'm having trouble with documentation tools. I hope someone can tell me if the problem is with the doc tools, such as pydoc, or with boost::python implementation. If I create a free function, this is what happens:...
45
3000
by: Joh | last post by:
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
2
3771
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to produce two messages having the same message digest. That conjecture is false, as demonstrated by Wang, Feng, Lai and Yu in 2004 . Just recently,...
3
2431
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3 --------------- Python 2.3.3 (#51, Dec 18 2003, 20:22:39) on win32 Type "help", "copyright", "credits" or "license" for more information. >>>...
1
3699
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am...
8
2115
by: metaperl | last post by:
Hi, I would like an IDE that shows me all methods and functions I can call on a particular data item. For instance, iter() can be called on any sequence, but it is not a method. Nonetheless, I would like for something to show me every thing that I can call on a particular data item. This includes % after a string.
2
3962
by: Chris Smith | last post by:
Howdy, I'm a college student and for one of we are writing programs to numerically compute the parameters of antenna arrays. I decided to use Python to code up my programs. Up to now I haven't had a problem, however we have a problem set where we are creating a large matrix and finding it's inverse to solve the problem. To invert the matrix...
3
2070
by: pycraze | last post by:
Hi , I am currently trying to implement base64 encoding and decoding scheme in C . Python has a module , base64 , that will do the encoding and decoding with ease . I am aware of OpenSSL having support for base64 encoding and decoding , but i will have to now implement both in C without using the openssl libraries . I was able to...
0
7813
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8066
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8106
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6461
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3743
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2251
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1350
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1066
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.