Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- primer.py
- ----------------------------------------------------------------------
- #!/usr/bin/python
- # Import modules for CGI handling
- import cgi,cgitb
- #Traceback Create instance of FieldStorage
- cgitb.enable();form =cgi.FieldStorage()
- # Get data from fields
- first_name =form.getvalue('first_name')
- last_name =form.getvalue('last_name')
- print("Content-type:text/html\r\n\r\n")
- print("<html>")
- print("<head>")
- print("<title>Hello -Second CGI Program</title>")
- print("</head>")
- print("<body>")
- print("<h2>Hello %s %s</h2>"%(first_name,last_name))
- print("</body>")
- print("</html>")
- ----------------------------------------------------------------------
- //////////////////////////////////////////////////////////////////////
- pocetna.html
- ----------------------------------------------------------------------
- <html>
- <head>
- </head>
- <body>
- <form action="primer.py"method="get">
- First Name: <input type="text"name="first_name"><br/>
- Last Name: <input type="text"name="last_name"/>
- <input type="submit"value="Submit"/>
- </form>
- </body>
- </html>
- ----------------------------------------------------------------------
- //////////////////////////////////////////////////////////////////////
- index.html
- ----------------------------------------------------------------------
- <html>
- <head>
- </head>
- <body>
- <form action="primer.py"method="get">
- Ime: <input type="text"name="first_name"><br/>
- Prezime: <input type="text"name="last_name"/><br/>
- Adresa: <input type="text"name="adress"><br/>
- Telefon: <input type="text"name="phone_nm"><br/>
- e-mail: <input type="text"name="mail"><br/>
- vrsta pice: <select name="dropdown">
- <option value="Kapricoza" >Kapricoza</option>
- <option value="Fungi" >Fungi</option>
- <option value="Vezuvio" >Vezuvio</option>
- </select>
- velicina: <input type="radio" name="size" value="25"> 25 cm
- <input type="radio" name="size" value="30"> 30 cm
- <input type="radio" name="size" value="35"> 35 cm<br/>
- dodaci: <input type="checkbox" name="pavlaka" value="on"/> pavlaka
- <input type="checkbox" name="jaje" value="on"/> jaje
- <input type="checkbox" name="cili" value="on"/> cili
- <br/><br/>
- <input type="submit"value="Submit"/>
- </form>
- </body>
- </html>
- ----------------------------------------------------------------------
- //////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement