View Full Version : PHP/MySQL vs. CGI
code beginner
10-23-2009, 06:54 AM
Hello,
I am working on my HTML and CSS skills right now. Eventually I plan to be running a small ecommerce site.
Eventually, I will need to know something about coding so that I can have a person on the site send emails through a contact-the-company internet page. I'll probably also have to have some sort of database system set up on the server, and a few of the other standard business elements.
It seems like PHP/MySQL would be a good choice for me. It seems to keep showing up when I try to research this stuff. But I really don't know anything, and there is also CGI.
I was hoping someone could explain the basics of PHP/MySQL vs. CGI, and why someone might choose one of those platforms over the other.
Or if I'm missing the idea entirely, please let me know how I should look at this. I'm trying to get the main idea of this.
Thank you for any insights.
oracleguy
10-23-2009, 07:06 AM
I've used CGI with Perl and I like it a lot. One of the huge advantages if you use Perl's CGI library and you make the entire page generated dynamically, if you want to move your site from say XHTML 1.0 to HTML5, just changing/updating the library on the server would cause all of your pages to become HTML5 compliant.
MySQL isn't exclusive to PHP, you can use it with Perl too and ASP and ASP.net.
I've done a lot of PHP web development and it is certainly nice. And then I tried it with Perl and it is now my first choice over PHP. But PHP is very popular and there are a lot of Internet resources on it.
drhowarddrfine
10-23-2009, 07:17 AM
There is no such thing as PHP/mySQL vs CGI. CGI is a protocol, not a language or database. Languages interface to CGI and PHP has a library to do just that. If you are using a web server you are probably using the CGI interface.
code beginner
10-23-2009, 10:48 PM
thanks for your replies.
so it looks like this:
perl and php are in some sort of category called script writing
CGI is something completely different
MySQL is a database environment on a server
I don't quite get how these pieces fit together
for example:
a computer keyboard is where you type in the information
the monitor is where you see the information
the cpu runs the programs and process the information
the hard drive is where the information is saved
the power supply powers the computer
how would you describe perl/php, MyQSL and CGI in terms of basic ideas like I did above?
I went to Wikipedia and read this: Perl is a high-level, general-purpose, interpreted, dynamic programming language. I still have no idea what they are talking about.
I'm looking for the basic ideas like: "You use perl to .... then this gets sent to the ........ which does...." "people who design shopping cart websites tend to use...." "CGI is for when you want to..."
oracleguy
10-23-2009, 10:56 PM
As drhowarddrfine said, CGI is just an interface, in fact it stands for Common Gateway Interface. It is just a way of executing scripts written in programming language like Perl or PHP.
CGI is not a language, it is just a way for web servers to have a standard interface to execute scripts. So if I wanted to create my own language and use it as a web scripting language, I would just need to build an interface to it that was compatible with CGI and a web server could run it.
oesxyl
10-24-2009, 03:28 AM
thanks for your replies.
so it looks like this:
perl and php are in some sort of category called script writing
CGI is something completely different
MySQL is a database environment on a server
I don't quite get how these pieces fit together
for example:
a computer keyboard is where you type in the information
the monitor is where you see the information
the cpu runs the programs and process the information
the hard drive is where the information is saved
the power supply powers the computer
how would you describe perl/php, MyQSL and CGI in terms of basic ideas like I did above?
I went to Wikipedia and read this: Perl is a high-level, general-purpose, interpreted, dynamic programming language. I still have no idea what they are talking about.
I'm looking for the basic ideas like: "You use perl to .... then this gets sent to the ........ which does...." "people who design shopping cart websites tend to use...." "CGI is for when you want to..."
in wikipedia pages some concepts have a link, try to follow them when you don't understand what means. You can also use foldoc:
http://foldoc.org/
best regards
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.