SlideShare a Scribd company logo
1 of 11
CGI JAVA
PROGRAMMING
What is CGI?
Definition of CGI
CGI (Common Gateway Interface) is a standard
protocol for web servers to execute programs that
execute like console applications running on a
server that generates web pages dynamically.
CGI was one of the first methods used to create dynamic content on
web pages, and though its use has declined in favor of other
technologies, it remains an important tool in web development.
Purpose of CGI
The purpose of CGI is to provide an interface
between the client (typically a web browser) and
the server to generate dynamic web pages and
interact with the user.
Evolution of CGI
Understanding CGI
Concept of CGI
CGI stands for Common Gateway
Interface, which is a standard protocol for
web servers to execute programs that
execute like console applications running
on a server.
Understanding how CGI is integrated with Java for
web development and server-side programming.
Functionality of CGI
CGI allows web servers to interact dynamically
with users through web forms and other access
methods.
Integration with Java
Difference Between CGI and Servlet
Setting Up CGI in Java
Configuring the web server to support CGI and Java for hosting applications and processing server-
side scripts.
Setting up the Java environment to ensure compatibility and seamless execution of CGI programs.
Server Configuration
Steps for proper execution of CGI scripts within the Java server environment.
Java Environment
Script Execution
Creating a Simple CGI Program in Java
Select a suitable integrated development
environment (IDE) for Java, such as
Eclipse or IntelliJ IDEA, to create CGI
programs.
Create a Java program that follows the
CGI protocol, including processing
HTTP request parameters and
generating the appropriate HTTP
response.
Choosing a Development
Environment
Compile the Java program into a .class file
using a Java compiler like javac, ensuring
that it is executable on the web server's
environment.
Writing the CGI Program Compiling the Program
Executing the CGI Program
Trigger the CGI program by making an HTTP request to the
server with the proper parameters, such as through a web
form or URL query.
Upon receiving the request, the server executes the CGI
program and processes the input data to generate the dynamic
content for the client.
The CGI program sends the generated content back to the
server, which then delivers it to the client to be displayed in the
web browser.
Invoking the CGI Program
Processing the Request
Returning the Response
BASIS FOR
COMPARISON
CGI SERVLET
Basic Programs are written in the native OS. Programs employed using Java.
Platform dependency Platform dependent Does not rely on the platform
Creation of process Each client request creates its own process. Processes are created depending on the type of the client
request.
Conversion of the script Present in the form of executables (native to the server
OS).
Compiled to Java Bytecode.
Runs on Separate process JVM
Security More vulnerable to attacks. Can resist attacks.
Speed Slower Faster
Processing of script Direct Before running the scripts it is translated and compiled.
Portability Can not be ported Portable
Example
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class CGIProgram {
public static void main(String[] args) {
// Read input from CGI request
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
StringBuilder requestContent = new StringBuilder();
try {
while ((input = reader.readLine()) != null && input.length() != 0) {
requestContent.append(input).append("n");
}
} catch (IOException e) {
e.printStackTrace();
}
}
// Parse input data (assuming it's in query string format)
String[] queryParams = requestContent.toString().split("&");
Map<String, String> params = new HashMap<>();
for (String param : queryParams)
{ S
tring[] keyValue = param.split("=");
if (keyValue.length == 2)
{
params.put(keyValue[0], keyValue[1]);
}
} // Generate HTML response
String name = params.get("name");
String response = "<html><head><title>CGI Program Response</title></head><body>";
if (name != null && !name.isEmpty())
{
response += "<h2>Hello, " + name + "!</h2>";
} else
{ response += "<h2>Hello, Stranger!</h2>";
}
response += "</body></html>";
// Output response
System.out.println("Content-type: text/htmln");
System.out.println(response); } }
Html file:
<!DOCTYPE html>
<html>
<head>
<title>CGI Form</title>
</head>
<body>
<h2>Enter Your Name</h2>
<form action="/cgi-bin/CGIProgram" method="post">
<input type="text" name="name" required>
<input type="submit" value="Submit">
</form>
</body>
</html>

More Related Content

Similar to Comman Gateway interface Java cgi pro.pptx

Server side programming
Server side programming Server side programming
Server side programming javed ahmed
 
Gwt session
Gwt sessionGwt session
Gwt sessionMans Jug
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016johannes_fiala
 
Advanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content deliveryAdvanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content deliveryAakash587
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web applicationRahul Bansal
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in ChoreoWSO2
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Docs Python Org Howto Webservers Html
Docs Python Org Howto Webservers HtmlDocs Python Org Howto Webservers Html
Docs Python Org Howto Webservers HtmlAkramWaseem
 
GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3Faiz Bashir
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
 
Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsJcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsjohannes_fiala
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-serviceshomeworkping3
 
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and VaadinSimple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and VaadinJian Wu
 
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDKCreating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDKMark van Aalst
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsAmazon Web Services
 

Similar to Comman Gateway interface Java cgi pro.pptx (20)

Server side programming
Server side programming Server side programming
Server side programming
 
Gwt session
Gwt sessionGwt session
Gwt session
 
Cgi
CgiCgi
Cgi
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016
 
Servlets
ServletsServlets
Servlets
 
Advanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content deliveryAdvanced mechanisms for dynamic content delivery
Advanced mechanisms for dynamic content delivery
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web application
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in Choreo
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Docs Python Org Howto Webservers Html
Docs Python Org Howto Webservers HtmlDocs Python Org Howto Webservers Html
Docs Python Org Howto Webservers Html
 
Asp
AspAsp
Asp
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
CGI.pptx
CGI.pptxCGI.pptx
CGI.pptx
 
Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsJcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applications
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services
 
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and VaadinSimple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
 
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDKCreating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 

Comman Gateway interface Java cgi pro.pptx

  • 2. What is CGI? Definition of CGI CGI (Common Gateway Interface) is a standard protocol for web servers to execute programs that execute like console applications running on a server that generates web pages dynamically. CGI was one of the first methods used to create dynamic content on web pages, and though its use has declined in favor of other technologies, it remains an important tool in web development. Purpose of CGI The purpose of CGI is to provide an interface between the client (typically a web browser) and the server to generate dynamic web pages and interact with the user. Evolution of CGI
  • 3. Understanding CGI Concept of CGI CGI stands for Common Gateway Interface, which is a standard protocol for web servers to execute programs that execute like console applications running on a server. Understanding how CGI is integrated with Java for web development and server-side programming. Functionality of CGI CGI allows web servers to interact dynamically with users through web forms and other access methods. Integration with Java
  • 5. Setting Up CGI in Java Configuring the web server to support CGI and Java for hosting applications and processing server- side scripts. Setting up the Java environment to ensure compatibility and seamless execution of CGI programs. Server Configuration Steps for proper execution of CGI scripts within the Java server environment. Java Environment Script Execution
  • 6. Creating a Simple CGI Program in Java Select a suitable integrated development environment (IDE) for Java, such as Eclipse or IntelliJ IDEA, to create CGI programs. Create a Java program that follows the CGI protocol, including processing HTTP request parameters and generating the appropriate HTTP response. Choosing a Development Environment Compile the Java program into a .class file using a Java compiler like javac, ensuring that it is executable on the web server's environment. Writing the CGI Program Compiling the Program
  • 7. Executing the CGI Program Trigger the CGI program by making an HTTP request to the server with the proper parameters, such as through a web form or URL query. Upon receiving the request, the server executes the CGI program and processes the input data to generate the dynamic content for the client. The CGI program sends the generated content back to the server, which then delivers it to the client to be displayed in the web browser. Invoking the CGI Program Processing the Request Returning the Response
  • 8. BASIS FOR COMPARISON CGI SERVLET Basic Programs are written in the native OS. Programs employed using Java. Platform dependency Platform dependent Does not rely on the platform Creation of process Each client request creates its own process. Processes are created depending on the type of the client request. Conversion of the script Present in the form of executables (native to the server OS). Compiled to Java Bytecode. Runs on Separate process JVM Security More vulnerable to attacks. Can resist attacks. Speed Slower Faster Processing of script Direct Before running the scripts it is translated and compiled. Portability Can not be ported Portable
  • 9. Example import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; public class CGIProgram { public static void main(String[] args) { // Read input from CGI request BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String input; StringBuilder requestContent = new StringBuilder(); try { while ((input = reader.readLine()) != null && input.length() != 0) { requestContent.append(input).append("n"); } } catch (IOException e) { e.printStackTrace(); } }
  • 10. // Parse input data (assuming it's in query string format) String[] queryParams = requestContent.toString().split("&"); Map<String, String> params = new HashMap<>(); for (String param : queryParams) { S tring[] keyValue = param.split("="); if (keyValue.length == 2) { params.put(keyValue[0], keyValue[1]); } } // Generate HTML response String name = params.get("name"); String response = "<html><head><title>CGI Program Response</title></head><body>"; if (name != null && !name.isEmpty()) { response += "<h2>Hello, " + name + "!</h2>"; } else { response += "<h2>Hello, Stranger!</h2>"; } response += "</body></html>"; // Output response System.out.println("Content-type: text/htmln"); System.out.println(response); } }
  • 11. Html file: <!DOCTYPE html> <html> <head> <title>CGI Form</title> </head> <body> <h2>Enter Your Name</h2> <form action="/cgi-bin/CGIProgram" method="post"> <input type="text" name="name" required> <input type="submit" value="Submit"> </form> </body> </html>