Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Inputs</title>
- </head>
- <body>
- <form method="get">
- Username: <input type="text" name="username">
- Password: <input type="text" name="password">
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
- package qwe;
- public class FirstCgi {
- public static void main(String[] args) {
- setContent();
- setHtml();
- }
- public static void setContent(){
- String content = "Content-type: text/html\n\n";
- System.out.println(content);
- }
- public static void setHtml(){
- String html = "<!DOCTYPE html>\n" +
- "<html lang=\"en\">\n" +
- "<head>\n" +
- " <meta charset=\"UTF-8\">\n" +
- " <title>Inputs</title>\n" +
- "</head>\n" +
- "<body>\n" +
- "<form method=\"get\">\n" +
- " Username: <input type=\"text\" name=\"username\">\n" +
- " Password: <input type=\"password\" name=\"password\">\n" +
- " <input type=\"submit\" value=\"Submit\">\n" +
- "</form>\n" +
- "</body>\n" +
- "</html>";
- System.out.println(html);
- }
- }
- #!C:\cygwin64\bin\bash.exe
- java -Dcgi.query_string=$QUERY_STRING -Dcgi.query_string=$QUERY_STRING qwe.FirstCgi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement