Solved

C++, forms and HTML

Posted on 2000-04-02
11
176 Views
Last Modified: 2010-04-09
Hi everyone. I am trying to do a search engine using C++. I know data structures in C++. I have an idea of what I want to do but i need to know how can I make my data structures work with a search engine. How do they work using forms. I have also a knowledge of Html. You help will be appreciated a lot. Here is what i want to do:

a seach engine of Restaurants

Lets first talk about how would i like the search engine page to look. It would be something like this.
-----------
                 Search
-----------
0 By Name
0 By Town

I have to have two options for searching. One would be by name and the other one would be by town. The Towns would always be the same. Lets say i have this:

List of towns:
1.Aguadilla
2.Cabo Rojo
3. Isabela
4.Mayaguez
5. San Juan

From that list i will have a pointer to the record of restaurants in that town.The records will look like this:

Name of restaurant
Type of food
next


Next will be a pointer to the next restaurant record in the town.For an example if the person selects Aguadilla, all the restaurants in Aguadilla will appear in a page with the info of their name and type of food.

Questions:
1. How do I implement a C++ program in a webpage?

2. How would a sequential search on the towns be done so that it would give all the restaurants in that town?

3. i'm planning to use this example to implement the town search using a binary search tree which would have the towns in its node and from its node it would have a pointer to the records of restaurants in the towns.

4. The part of the search by name is gonna be done using a hash tables of the restaurant names which would be like 100 of them divided in the towns. The names of the Restaurants in the hash table would be encodes if possibles using six digit numbers and would have a link to the records with the restaurants info as before.

thanx
0
Comment
Question by:milalik
  • 6
  • 5
11 Comments
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
1. You should make your C++ program exactly so that whenever a page on your server is requested, the executable will be called which then will send back the HTML file. I won't get into the C++ details right now, since this isn't the right board for it....but I think it's better for you to use Delphi for this anyway, since they support the HTML and stuff way better than the C++ software.

2. I think you didn't explain this too well. You said that the city list will contain a pointer to all the restaurants in that city, so you just loop through all those specified restaurants. Maybe you'd better think of a structure which will also contain the city-name. It's 1) easier for you to check and 2) easier to let the user search on the restaurant so you'll know the place. You really should consider this.

3. Wrong idea IMHO, but that wasn't a question anyway.

4. Not a question either.

Sidenotes, it seems like you want to use what you have learned into such a program. But such a program can be made really easy without the use of a C++ program (which in this case will be way slower, since the executable will keep increasing every time you add a new restaurant). You should consider using a database for this and using SQL queries to retrieve all your information. It's not normal to make a search engine with a C++ program....

Good luck anyway.
0
 

Author Comment

by:milalik
Comment Utility
I know it is not normal to do it this way. But thats the way I would like to do it for now. Don't have time to learn other languages right now.

0
 

Author Comment

by:milalik
Comment Utility
About doing a form like the one i talked about. How do I do this?
I know to do simple forms but not ones that allow multiple selecting.

thanx
=)
0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
like

<select multiple name=MyList>

<option>...</option>
....

</select>

???
0
 

Author Comment

by:milalik
Comment Utility
whats that cj?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
That's multiple selection in a combo box..that's what you were asking, right?
0
 

Author Comment

by:milalik
Comment Utility
can you explain in more detail?
thanx
0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
Sure,
if I understand correctly you want more than one selection on the HTML page, right?

Well, you need a form, and a selection box. So yu put in:

<form>

<select multiple name=MyList size=5>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</form>

if you put this in your htmnl file, you can select multiple values.

But I don't think that's what you wanted to know
0
 

Author Comment

by:milalik
Comment Utility
Nope that is not exactly what I wanted to know. What i wanted to know is that I want the user to be able to do diferent types of search and be able to selct the type of search he/she wants. Here is an example:

--------------
                   Search
--------------
oBy name
0By location

the person should be allowed to choose between this two
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
Comment Utility
Like:

<form action="...">
<select name=MyList>
<option value=1>By Name</option>
<option value=2>By Location</option>
</select>
<input type=submit>
</form>

Here you can only choose between these 2...after pressing submit the value you choose will be sent to the page you specified in the action.

0
 

Author Comment

by:milalik
Comment Utility
thanx
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 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

9 Experts available now in Live!

Get 1:1 Help Now