Punit
Punit

Reputation: 35

How to call a CGI function on HTML button click

I have an HTML form. I have a Submit button which calls a CGI script(function), defined and declared in a C file.

Similarly, I want to call a "save function"(CGI script) on save button click. So, my question is how can I call a CGI script on button click on HTML form.

I am a newbie to HTML and CGI, but need to implement this.

Upvotes: 2

Views: 12025

Answers (1)

Ivan
Ivan

Reputation: 31029

You need to send the data of HTML form to your CGI file via GET or POST request. For example;

<form action="cgi-bin/save.cgi" method="post">

When you click to save button, it'll call the save.cgi

Upvotes: 1

Related Questions