Solved

Do Youu KNow Of C++ for CGI Rsources?

Posted on 1998-09-30
8
213 Views
Last Modified: 2013-12-25
I am new to C++ and am looking for info on replacing perl
   scripts for cgi with C++ programs....I would rather write C++ than perl for many things on our
   web servers.
0
Comment
Question by:vernk
8 Comments
 
LVL 5

Expert Comment

by:b2pi
Comment Utility
Other than arguments come in from the environment, just like perl, and
you print to stdout for the resultant html, just like perl, what do
you want to know?
0
 

Author Comment

by:vernk
Comment Utility
Thanx for the interest b2pi....basically I'm looking to find
reference literature on the subject...pretty much anything
that will help me to understand......so I can see how to
do things like pull the info from value pairs in a form and pass it/process it, then output it,etc....I figure I should probably put the effort into the C++ rather than splitting myself between the two.  
0
 
LVL 8

Expert Comment

by:MaDdUCK
Comment Utility
are you fluent in C++?
0
 

Author Comment

by:vernk
Comment Utility
MaDdUCK,
No, just beginning.....I've been an isp for 4 years (nt3.51-4.0) and have a very narrow scope of practical knowledge....just hacked some perl scripts for a couple customers (with help from here) and have been wanting to get a basic foundation in C....the local com. college only offers C++ classes, so I'm the cherry old guy (41) in the class. I do have needs for perl like scripts, but figured i might as well write them in C++. I'm trying to get a handle on how to pass things from forms to a C++ program and back to some virtual pages that are built on the fly. Any documentation you know of is appreciated.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 8

Expert Comment

by:Answers2000
Comment Utility
vernk -

1. Buy an introductory book on C++.  Browse your local books store and find the one that best suits your level of knowledge (which isn't clear from the comments you made).

2. Buy this book

The CGI Book
By William E. Weinman
ISBN 1-56205-571-2
Published by New Riders Publishing 1996

It doesn't explain C (it assumes a basic knowledge).  It will tell and show you how to write C (plus a few Perl and shell script examples mostly for comparison - but I would think this helps given your previous experience)

Quite often the book gives an example in Perl or shell script, and then the same thing in C.

Here is the review I wrote of it:

(begin quote)

This is a book I really like.  It's not flash, it's not cool, but it's packed with tons of useful information, and you won't need a Fork Lift Truck to carry it around with you.

In terms of content this book is mostly UNIX, Perl and C orientated, which will make it appear dated to some.  You won't find the latest web gadgets covered within it's pages, but you will find plenty of good advice about writing CGI programs.

Thankfully this book also avoids one of the most common pitfalls with Internet and computing books - it doesn't try to teach you everything.  As you build up your library of technology books, you'll appreciate not having yet another introduction to basic C programming or HTML.

Apart from covering the basics of creating a CGI program, the book also walks you through many related topics including processing forms, URLs (the clearest explanation I've seen yet), image maps, cookies and server side includes.

Given the current concern about Internet security, I was also glad to see an entire (and thoroughly readable) chapter about security issues with CGI, as well as a scattering of security discussions through out the book whenever an issue arises.

The only criticism that I would make concerns the quality of the source code.  While I'm sure each example program would work, and is individually clear, if used as the starting point for larger project, you could quickly get into trouble.  C programming newbies, in particular, should be aware that these are examples rather templates.  

In conclusion, this is an excellent book.  If you consider yourself a web technologist you should buy it.  Even if you consider yourself an expert, you still might find surprises in its well-crafted pages.


(end quote)


3. Another good book

ActiveX Web Programming
By Adam Blum
ISBN-0-471-16177-2
Published by John Wiley & Sons, Inc. 1997

This has chapters on C++ CGI and ISAPI and includes some really nice sample code.  Some of this book may not be relevant to you, but in combination with the CGI book listed in #2, this makes a great combination.

Here's a review I wrote on this

(begin quote)

If you're looking for a book containing a pretty good single volume overview of Microsoft Internet and Intranet technologies, then this is it.    

This book is well put together and well thought out.  It doesn't try and teach you everything, for example, it (happily) omits tutoring you on HTML and other web basics.  Because of this wise decision and some good editing, it manages to pack a tremendous amount of information into the 277 pages of the main text (there's about another 120 pages of Appendices as well which is mostly source code).

In general there's one chapter per topic, and topics include ISAPI, VBScript, IIS,
Perl, Java, CGI, ActiveX Server and as well as ActiveX controls. Of course each of these topics would merit a book in itself, so don't expect too much detail.  However I found that each chapter was enough for me to understand the basics of a technology, and get me started.
 
So what's not included, and what could be improved?

Obviously you can guess by the title, this book is strongly Microsoft focused (but not as much as you might think).  Fortunately, this book avoids the "lecturing" element you find in so many books of this kind, but still don't expect to find much on rival technologies such as those from Sun or Netscape.  

The weakest chapter is the one about Perl, frankly you won't learn Perl by reading its 26 pages - though it does make a valiant attempt.  

To some, the most serious deficiency will be that books like this, date very quickly.  The information contained within is still accurate, but you won't find any information about all the latest Internet gadgets from Microsoft.

In summary I would recommend this book without any reservation to anybody who is building a Microsoft based Intranet.  If you're targeting the Internet, then you should still seriously consider this book, but buy some others too!  

(end quote)

I hope this helps.
0
 
LVL 1

Expert Comment

by:wisdom042597
Comment Utility
C++ and CGI are two different things.  What you really need to do is learn C++ first and then get ahold of a basic C++-based CGI library and you'll be in business.  Beyond that you want to get a grasp of CGI fundamentals (MIME headers, setting Cookies if necessary, etc.)  
0
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 0 total points
Comment Utility
This is what I was saying.
For a start on C++, get Bjarne Stroustrup's _The C++ Programming Language_ (http://www.amazon.com/exec/obidos/ASIN/0201889544/o/qid=908898589/sr=2-1/002-9422771-2473620) and work your way through it. Get fully acquainted with output and input, different types, classes, and everything else.

Then surf to www.cgi-resources.com and check out the documentation there. The next thing to do is to download a good CGI library written in C or C++ and study it. You can also find such at the last site.

Finally, the following books could be of help:
(the first proposed by Answer2000)
NCSA HTML 1.1 Specifications
W3C CGI 1.1 Specifications

if you have any questions then please ask. Over the past year I have been going through the process that you are about to go through and I should know how to help you. You can find contact information on my webpage which is cited in my profile page (click my name above)...

hope this helps.
MaDdUCK
0
 
LVL 8

Expert Comment

by:MaDdUCK
Comment Utility
of course I would appreciate more than _5_ points --> for just 5 points I will not be able to give you more info than what I just gave (which was a lot more than a 5 pointer anyhow)...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now