Page 1 of 1

What is CGI

Posted: Thu Aug 26, 2004 6:28 pm
by MrSelf
? What is CGI, I've been trying to work on getting my mailing list working better, and I keep coming back to cgi everywhere I look. I was under the impression it was graphical.... what is CGI and what are it's uses? (and if anyone can help me make a form for a mailing list that works well, let me know)

Archived topic from Anythingforums, old topic ID:885, old post ID:9189

What is CGI

Posted: Thu Aug 26, 2004 6:48 pm
by Red Squirrel
CGI(common gateway interface) is a way to execute a script server side, using a web based format. So whatever you put in your cgi-bin directory will be executed by the associated interpreter, which is usually pearl.

php can do the same that cgi can (in most cases) and is more secure so you might want to use php to mail instead which is probably easier then in pearl. All you need is the mail() function.

Archived topic from Anythingforums, old topic ID:885, old post ID:9190

What is CGI

Posted: Thu Aug 26, 2004 9:10 pm
by MrSelf
Red Squirrel wrote: CGI(common gateway interface) is a way to execute a script server side, using a web based format. 
Uh huh, I understand so far....
So whatever you put in your cgi-bin directory will be executed by the associated interpreter, which is usually pearl. 

php can do the same that cgi can (in most cases) and is more secure so you might want to use php to mail instead which is probably easier then in pearl.  All you need is the mail() function.
Ok, everything's foreign.... :D I have no experience at this side of the web.

Archived topic from Anythingforums, old topic ID:885, old post ID:9269

What is CGI

Posted: Thu Aug 26, 2004 9:16 pm
by Red Squirrel
Basically the way it works is that if you were to put a program (such as an exe, if the server is windows) in the cgi-bin, when you would open the program in your browser, it would execute the program on the server.

But with pearl, it can interact back with the user. Well a C++ program could but it's limited by the platform the program is written for. while a pearl script runs on any platform and the language is designed for this.


In your case, what you probably want is to receive an email whenever someone fills out a form, so with php you would go something like this:


<form action="script.php" method="POST">
<input type="text" name="variable">
<input type="submit"></form>


Then in script.php you would access the variable $_POST[variable] to get the entered value, so you could punch that in the mail() command and go from there.

But not sure if you know php or not so you'd have to learn it first. pearl is more complicated so that's why I think php is better in your case. (and more efficient on the server)

I have a php tutorial on my site if you want to learn.

Archived topic from Anythingforums, old topic ID:885, old post ID:9272

What is CGI

Posted: Thu Aug 26, 2004 9:19 pm
by MrSelf
Red Squirrel wrote: In your case, what you probably want is to receive an email whenever someone fills out a form, so with php you would go something like this:


<form action="script.php" method="POST">
<input type="text" name="variable">
<input type="submit"></form>
Right, this I know, I have the same form but script.php=mailto:
Then in script.php you would access the variable $_POST[variable] to get the entered value, so you could punch that in the mail() command and go from there.
Theoretically, I understand...
But not sure if you know php or not so you'd have to learn it first.  pearl is more complicated so that's why I think php is better in your case.  (and more efficient on the server)

I have a php tutorial on my site if you want to learn.
I very well may do that. :)

Archived topic from Anythingforums, old topic ID:885, old post ID:9275

What is CGI

Posted: Thu Aug 26, 2004 9:21 pm
by sintekk
MrSelf wrote: ? What is CGI, I've been trying to work on getting my mailing list working better, and I keep coming back to cgi everywhere I look. I was under the impression it was graphical.... what is CGI and what are it's uses? (and if anyone can help me make a form for a mailing list that works well, let me know)
http://www.thefreecountry.com/webmaster/mailinglists.shtml

I like the KISS method of doing things (Keep It Simple Stupid!) If another site hosts what you need, why not let them do the work? :D

(Me myself, I'm learning Coldfusion; it's mail command is VERY simple, but Coldfusion costs a helluva lot more than PHP, which is free :lol:)

Archived topic from Anythingforums, old topic ID:885, old post ID:9276