[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C++ CGI Help Needed

Posted on 1998-02-07
7
Medium Priority
?
182 Views
Last Modified: 2013-12-25
I want to make a CGI Script that searches a file for keywords, and then returns an HTML page stating what it found...A search engine.  For example, if I wanted to search for "Luke Skywalker" (This is going to be a search engine of Star Wars characters and places), it would return an HTML page stating that is found something about Luke Skywalker, and then has a link to the page that tells about him.  

Now, Here are my questions:

1. What kind of file would I use as the database?  Can C++ read and write off of TXT or H files?  I mean, if put a class into an "H" file, (Like stdio.h, only it would be one of my own.) could it read it so that it would send a link to be put on the HTML page when it matched a certain string?

2. Do I need to compile the source code once I have written it?  Do I just compile it to an EXE file, and then change the extension to CGI?

3. What do I have to do to make sure that this code will run as a CGI script, and not as a normal C++ program?

5. Are there any special library files I need to use with a C++ CGI script?  Where would I get those?

4. Are there any free compilers that I can get that would run ok with Windows 95?  I am trying to understand DJGPP right now, but it isn't working because it is made for DOS.  I also have Turbo C++ LITE, but that won't compile into and EXE file that I can use outside of the IDE.

Thank you anyone for taking time to read this, and if you can answer any of these, I would greatly appreciate it.



0
Comment
Question by:Topace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
julio011597 earned 210 total points
ID: 1831965
To answer your first question more details are needed:

what kind of archive are you going to search into?
BTW, yes, C++ can access text files, so can access header files as well, though a bit unusual.

About the other questions:

2. yes, compile your source as usual, then (most if not all web servers require you to) change the extension to ".cgi";

3. you just need to properly setup your web server, so that CGI scripts are enabled and there's a directory where they can be run from (the often heard "cgi-bin");

4. the only free compilers i know of come from the GNU foundation: gcc and its siblings.

To get more details, just add comments and i'll be glad to go deeper into the question.

Regards.
0
 
LVL 1

Author Comment

by:Topace
ID: 1831966
How do I set up the server?  I mean, is there something special I need to do to get it to read CGI scripts?



Scott
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1831967
This depends on what web server you are using.

Anyway, the web server configuration usually has stuff related to CGI, where basically you have to tell wether you want CGI enabled or not, and, if enabled, you should specify which particular directory should be allowed to hold CGI programs.

-julio
0
What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

 
LVL 1

Author Comment

by:Topace
ID: 1831968
It really isn't my server.  How do I know if the server allows CGI scripts?  When I tried to use my CGI script, it started out right, with the HTML document (It placed the right title on the page, so I am sure it is reading it in HTML), but then it had all this other gibberish.  How do I get it to eliminate the gibberish?
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1831969
I cannot answer this, unless you show your code.

Anyway, keep in mind this: when you compile your source under, say, Win95, you have build a Win95 executable, so it won't work on your ISP server, unless its OS is Win32 as well.

If your ISP server is running a different OS than yours, you should upload your sources to it and compile with _its_ compiler.

The best way to solve your problems is contacting your ISP directly.

Good luck, julio
0
 
LVL 1

Author Comment

by:Topace
ID: 1831970
It it very simple code.  If you give me your email address, I can send it to you.


0
 
LVL 5

Expert Comment

by:julio011597
ID: 1831971
Ok, i won't give for sure that i'll make it work, but feel free to send it at: julio@webzone.it
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

656 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