Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.41 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Inputs</title>
  6. </head>
  7. <body>
  8. <form method="get">
  9.     Username: <input type="text" name="username">
  10.     Password: <input type="text" name="password">
  11.     <input type="submit" value="Submit">
  12. </form>
  13. </body>
  14. </html>
  15.  
  16.  
  17.  
  18.  
  19. package qwe;
  20.  
  21. public class FirstCgi {
  22.  
  23.     public static void main(String[] args) {
  24.         setContent();
  25.         setHtml();
  26.     }
  27.  
  28.     public static void setContent(){
  29.         String content = "Content-type: text/html\n\n";
  30.         System.out.println(content);
  31.     }
  32.  
  33.     public static void setHtml(){
  34.         String html = "<!DOCTYPE html>\n" +
  35.                 "<html lang=\"en\">\n" +
  36.                 "<head>\n" +
  37.                 "    <meta charset=\"UTF-8\">\n" +
  38.                 "    <title>Inputs</title>\n" +
  39.                 "</head>\n" +
  40.                 "<body>\n" +
  41.                 "<form method=\"get\">\n" +
  42.                 "    Username: <input type=\"text\" name=\"username\">\n" +
  43.                 "    Password: <input type=\"password\" name=\"password\">\n" +
  44.                 "    <input type=\"submit\" value=\"Submit\">\n" +
  45.                 "</form>\n" +
  46.                 "</body>\n" +
  47.                 "</html>";
  48.         System.out.println(html);
  49.     }
  50. }
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. #!C:\cygwin64\bin\bash.exe
  58. java -Dcgi.query_string=$QUERY_STRING -Dcgi.query_string=$QUERY_STRING qwe.FirstCgi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement