Gossamer Forum
Home : Products : DBMan : Installation :

HTTP Error 400

Quote Reply
HTTP Error 400
Hi Again!

We are almost finished with setting up our database and putting it up on line, but one more stumbling block has presented itself.

While attempting to create an html page with links to specific groups of records sorted by a field named "Category" and using the syntax from the Readme file, we are getting an HTML Error 400 message that reads as follows:

"HTTP Error 400
400 Bad Request

Due to malformed syntax, the request could not be understood by the server. The client should not repeat the request
without modifications."

The readme file states:
"To do a search for 'cgi' in a field called 'title' you could do: http://server.com/cgi-bin/db.cgi?db=mydb&uid=default&view_records=1&title=cgi"

So I modified that syntax to read:

"<a href="http://IDunno4Recipes.com/cgi-bin/dbman/db.cgi?db=archive&uid=default&view_records=1&category=Appeteasers Dips & Snacks">Appeteasers Dips & Snacks</a>"

The FrontPage98 editor wants to alter the "&" to "&" but even when I correct that by editing the page in Notepad, we still get the same error.

1) Do you see anything I am missing here?
2) Can the Short Display be expanded to create a three tier display returning first only a list of available Categories, that can be clicked on to return a list of all records with the desired data in the specified field?
3) Are we asking way too much?

Hope you can get back to me soon as tomorrow is the announced launch date for this project. I thought this part would be simple. Silly me!

Thanks,
Big Britchs




------------------
BigBritchs
BigBritchs@IDunno4Recipes.com

Quote Reply
Re: HTTP Error 400 In reply to
I'm going to make a wild guess and say that the & in Dips & Snacks should be hard coded like this:

Code:
& amp;
Take out the space between the & and the amp;

[This message has been edited by ChrisE (edited June 21, 1999).]

[This message has been edited by ChrisE (edited June 21, 1999).]
Quote Reply
Re: HTTP Error 400 In reply to
Hi ChrisE!

You are probably right, except FrontPage98 still wants to mess with it. I'm thinking I may be forced to write the entire page in a text editor and forget about FrontPage for this application.

But I'ld still appreciate any comments about the general syntax of the commands as I've writen them. See any errors or have any other suggestions?

BB

------------------
BigBritchs
BigBritchs@IDunno4Recipes.com

Quote Reply
Re: HTTP Error 400 In reply to
I guess what I would do, and what I have done in the past is to use codes for actual categories. Such as, for Appeteasers Dips & Snacks, I would use app_dip_snack.

Of course, you would have to change the .cfg file, and any input fields you have.
Quote Reply
Re: HTTP Error 400 In reply to
Thanks, ChrisE, I'll look into that.

Meanwhile, I've been playing with this and still haven't quite got a handle on it.

When I type the entire line directly into the Location bar on my browser AND substitute a one-word (i.e. no spaces) category like "Beverages" or "Breakfasts" , I DO NOT get the http error, but the search still comes back invalid saying "Search Failed - no search terms specified."

Also, question: What does the "1" refer to in the part of the statement "view_records=1" ?
Is that how may records it will return, the field position number, or what?

I'll keep plugging away. Any comment or ideas would be appreciated, though!

BB


------------------
BigBritchs
BigBritchs@IDunno4Recipes.com

Quote Reply
Re: HTTP Error 400 In reply to
If you set up a link for a search, rather than going through a form, you need to do some formatting of the text first. (The form formats it automatically.)

This is for an html page and not within DBMan? If so, use

"<a
href="http://IDunno4Recipes.com/cgi-bin/dbman/db.cgi?db=archive&uid=default&view_records=1&category=Appeteasers+Dips+%26+Snacks">Appeteas ers Dips & Snacks</a>"

Code:
if ($in{'add_form'})...
elsif ($in{'add_record'})...
elsif ($in{'view_search'})...
elsif ($in{'view_records'})...

The $in{'something'} variables are returned after the script parses the form. The list of actions in the above section of the db.cgi script tells the script what to do. If, for example, $in{'view_records'} is equal to something (anything except 0), the action on the rest of the line will execute.

You can use just about anything in place of the 1 in "view_records=1." You can't use a 0 and I don't know if you could use a negative number. But anything else will work. The following will all have the same result:

Code:
view_records=1
view_records=1000
view_records=fred
view_records=aspidistra

Oh, yeah. One other thing that won't work is something that has spaces in it. You can use

view_records=View+Records

but not

view_records=View Records

Still, using a "1" is easy, it's short and it's something you don't have to think about.

------------------
JPD





Quote Reply
Re: HTTP Error 400 In reply to
Hi JP!

Thanks for the input, but I think I've found a cheep trick to finding out the answer to these types of questions. I just performed the search I needed in DBman and then stole the exact location bar info using "select All" and "copy."

With just a little experimentation, I came up with the following line:

<a href="http://www.IDunno4Recipes.com/cgi-bin/dbman/db.cgi?db=archive&uid=default&Category=Appeteasers+Dips+%26+Snacks&sb=4&so=ascend&view_rec ords=Find+Recipes>;Appeteasers Dips & Snacks</a>

This provides what we want which is to have an html page on our site that has a list of ALL the categories in our database. Then a user can choose a category and see a titled (thanks to you) list generated by DBman. Of course they'll still be able to go directly into the database and look around to thier heart's content or use the search feature, but we wanted a way to display what was there on our website, too.

The issue I had originally was that the code in the readme file wouldn't work. Still doesn't seem to. But what the heck, it is still nice to hear from you!

BB

------------------
BigBritchs
BigBritchs@IDunno4Recipes.com