Advertisement

CGI

Started by May 28, 2000 02:03 PM
16 comments, last by webspynner_99 24 years, 9 months ago
Good link, Michael!

Wish I had this information a few years ago!
Felt instead of making a new post I''d write my question here. I want to put a counter on my page, which is hosted by virtualave.net and they support cgi, but I can''t figure out how to get a working counter onto my site. I''ve tried 3 different ones. One for Unix(which my server has), and 2 for windows which I have. Could anyone lead me in the direction of a simple text counter?
Advertisement
Have never tried this, but I suppose you could do a counter like this:

1. Create a file which contains "0" (without the quotes).
2. Make a script which opens the file, stores the number in an integer, increases the integer, clears the original file and then writes the new integer to the same file again.
3. Then make the script output the number if you want to.

Or you could just go to Matt''s Script Archive and download his webcounter. Or if you want to make it real easy for you, go to The Counter.com and sign up for a free counter. Then you just put the source that they give you on your website

/. Muzzafarath
Mad House Software

Ventis secundis, tene cursum - Go with the flow.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
I decided to learn Perl. It really doesn't seem that hard. I managed to write a simple counter with 9 lines of Perl code Piksel, if you want it, I can send it to you.

Anyway, can anyone recommend a good book? I checked out those free books at informit.com, but if I want to learn something, I need to have a "real book"

/. Muzzafarath
Mad House Software

Noli me vocare, ego te vocabo - Don't call me, I'll call you.

Edited by - Muzzafarath on May 31, 2000 12:23:48 PM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Unless you have your on server or are on very good terms with an ISP you wont be able to find anywhere that supports C++ CGI. EXE files are too much of a risk and can easily be exploited... its one of the reasons great languages like perl and PHP (which im learning at the mo and it's brilliant) were created. Anyways... anyone learning perl etc good luck!

/home/./~jumble
---------------

Edited by - jumble on June 3, 2000 5:40:03 PM
jumble-----------
CGI with C is easy if you know C! Finding a host that will let you compile and run your CGI programs is not that hard either. You must upload your source code and compile on the host server. Get a Unix server and use gcc to compile.

Put your CGI program in your cgi-bin directory. Your HTML page calls the CGI program and the information is by default sent via a "GET" but this can be changed to a "POST" in the HTML code. "POST" data is read in by your CGI program from stdin. "GET" data is read from argv and argc.

Whatever your program prints (stdout) is sent back to the browser. You MUST printf ("Content-type: text/html\n\n") FIRST so the browser knows what kind of data it is receiving. You must do the double \n thingy or it won''t work.

Here''s an link to a book on the subject:

http://shop.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=2IMWZ1LZE7&mscssid=QH1TMKPH71S92MQ1001PQUW78QDG094B&srefer=&isbn=0201422190

Here''s another book:

http://shop.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=2IMWZ1LZE7&mscssid=QH1TMKPH71S92MQ1001PQUW78QDG094B&srefer=&isbn=0137123582

These books are usually on the shelf in your local Border''s or Barnes and Noble.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Advertisement
Any free places to post websites that would allow CGIs?
Hypermart
VirtualAve
Tripod

/. Muzzafarath
Mad House Software


I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall

This topic is closed to new replies.

Advertisement