Skip to content

Instantly share code, notes, and snippets.

@iArnold
Created January 19, 2016 20:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iArnold/7c55596b1201c2d90e0f to your computer and use it in GitHub Desktop.
Save iArnold/7c55596b1201c2d90e0f to your computer and use it in GitHub Desktop.
Red [
title: "Red CGI test input from POST and/or GET using input from ansi.red"
]
#include %../../../fossil/C-library/ansi.red
standard-input: input
env-vars: get-env "REQUEST_METHOD"
print "Content-Type: text/html^/" ;-- Required Page Header
html: "<html><body>"
code: "<h2>Test Red CGI input!!</h2>"
html: append html code
code: env-vars
html: append html code
code: " <br />"
html: append html code
code: standard-input
html: append html code
code: {
<form name="Redform" action="redcgipost.cgi" method="post" target="_self">
<fieldset>
<legend> "Add a short text:" </legend>
<p>
<label for="title-text"> "Text" </label>
<input type="Text" id="formtitle" name="title-text" maxlength="200" size="40" />
</p>
<p>
<input class="forminputbutton" type="Submit" name="submit" value="Add the text" />
</p>
</fieldset>
</form>
}
html: append html code
code: "</body></html>"
html: append html code
print html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment