An easy HTMLPYTHON CGI Im extremely new to HTML and Im start
An easy HTML/PYTHON CGI
I\'m extremely new to HTML and I\'m starting python again after a few years abscence.
Here is my current HTML code:
What I\'m trying to do is simply take a user input and whatever cipher command they choose (ex. make it all upper case/lowercase, reverse order, dummy, etc.), and then print back onto the website. As you can see I\'m sending the user information into do_cipher.cgi, where they are asking for two functions; user_input and cipher_selected. The actual python code where I manipulate the text is not what I\'m concerned about, I can easily figure that out. I need help on how to start writing this code. I don\'t know how to take the data from my HTML and send it to my do_cipher.cgi and then back to the HTML. If somebody could provide a way to start and go about this that would be helpful. Also the current HTML is not set in stone, it can be easily editted incase there needs to be some changes there. Thank you.
DOCTYPE html> body Enter some text and use a cipherSolution
HTML File
<!DOCTYPE html>
<body> Enter some text and use a cipher!1
<form action = \"do_cipher.cgi\" method=\"GET>
Enter your text: <br> <input type = \"text\" name=\"text\"› <br>
Enter Cipher:<br> <input type=\"text\" name= \"cipher\"› <br><br>
<input type = \"submit\" value=\"Enter\"›
</form>
</body>
</html>
Now, Couple of things you need to understand here.
1. If you add a button of type \"submit\" in a HTML form all data (Text box, select, radio button etc) will be automatically sent to the url mentioned in form action as soon as you click the submit button.
2. You do not need to worry about send data back. Lets assume you have a HTML page named test.html and you are calling a CGI page as action. When a user click submit button all data in the form is sent to the CGI page. So the control transferred to the CGI page bit the HTML page keeps waiting for the response from the CGI page. So whatever you output/print from the CGI page will be shown right on the HTML page.
