What is CGI

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
MrSelf
Posts: 2882
Joined: Fri Jun 25, 2004 8:01 pm

What is CGI

Post 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
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

What is CGI

Post 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
Honk if you love Jesus, text if you want to meet Him!
User avatar
MrSelf
Posts: 2882
Joined: Fri Jun 25, 2004 8:01 pm

What is CGI

Post 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
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

What is CGI

Post 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
Honk if you love Jesus, text if you want to meet Him!
User avatar
MrSelf
Posts: 2882
Joined: Fri Jun 25, 2004 8:01 pm

What is CGI

Post 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
sintekk
Posts: 4994
Joined: Mon Feb 16, 2004 10:38 pm

What is CGI

Post 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
Locked