?
Solved

C++, forms and HTML

Posted on 2000-04-02
11
Medium Priority
?
185 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
ID: 2677791
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
ID: 2678033
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
ID: 2678037
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:CJ_S
ID: 2679388
like

<select multiple name=MyList>

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

</select>

???
0
 

Author Comment

by:milalik
ID: 2681379
whats that cj?
0
 
LVL 22

Expert Comment

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

Author Comment

by:milalik
ID: 2683670
can you explain in more detail?
thanx
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2684162
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
ID: 2686143
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 150 total points
ID: 2686517
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
ID: 2697913
thanx
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay 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)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

862 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