Archived

This topic is now archived and is closed to further replies.

Ways to run cgi-scripts on web page?

This topic is 5375 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I''d like to know what kind of ways there are to run cgi-script on web page. I know the following:
  
* directly open script.cgi in browser

* <script language="JavaScript" src="script.cgi"></script> where script.cgi prints javascript code.

* <img src="script.cgi"/> where script.cgi prints image location

  
Are there other ways?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
CGI is a server application. IT DOES NOT RUN ON THE CLIENT. Perl is cgi. javascript is not.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
CGI is a server application. IT DOES NOT RUN ON THE CLIENT. Perl is cgi. javascript is not.


Well, I know this. Just used wrong words.
So how to put cgi-script produced code to html page?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
When the CGI script is executed by the webserver, then anything it sends to stdout will be sent to the client.

Share this post


Link to post
Share on other sites
The web server needs to provide a cgi binary directory, you need to put your cgi application in there, and you need to call that application by accessing a url, often with a POST or GET from a form.

Share this post


Link to post
Share on other sites
Anything you can get from a webserver, like an html page, an image, a block of javascript, any other kind of file; any of these things you can use a script for instead. usually you''d set it up so it was obvious that it was a script by the filename: index.php instead of index.html for example, but it doesn''t have to be. you could set your webserver up to handle requests for "image.gif" by running a php script and sending its output (presumably, gif image data) instead of just serving a static file.

setting up your webserver to run scripts / CGIs of whatever sort (compiled C, shell scripts, perl, php, etc) and how you want to handle their naming is a matter of reading your webserver documentation.

I reccomend playing around with apache+php, all should become clear.

--
Jon
(weeeeeeeeeeeeeeeeeee)

Share this post


Link to post
Share on other sites