Hi - I cant compete with you on python, but I did the same in PHP. The main purpose was just give more code, but it really hurt me to see a simple project like this to two files - and that it returns non valid code by W3C standards (no offence in any way!!).
So this has one PHP file, it first gives user a form to send and when it's called with sending the form at same time it shows the Hello... message. You can see i at http://salamanteri.homelinux.net/php/hellolinux.php
CGI using PHP
hellolinux.php
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Hello Ubuntu</title> <!-- PHP CGI HelloUbuntu contribute --> </head><body> <?php if (!isset($_POST["name"])) { ?> <form name="input" action="hellolinux.php" method="post"> What is your name? <input type="text" name="name"> <input type="submit" value="Submit"> </form> <?php } else { print "<b>Hello ".$_POST["name"].". Welcome to your Linux!</b>\n"; } ?> </body> </html>
Bookmarks