Gossamer Forum
Home : Products : DBMan : Installation :

Select option not operating in HTML.pl

Quote Reply
Select option not operating in HTML.pl
I have tried to use the build_select_form option for a category but every time a try it, I am returned with a syntax error for that line, I have copied and pasted the original lines from the download, but no joy, any help would be appreciated, thanks
Quote Reply
Re: Select option not operating in HTML.pl In reply to
If you have

|; print &build_select_field("FieldName",$rec{'FieldName'}); print qq|

on the line, then the syntax error is somewhere before the line the debugger is giving you.



------------------
JPD
Quote Reply
Re: Select option not operating in HTML.pl In reply to
Hey DC,
I'm working on the same thing myself but I got it working with everybody's help. I don't know the exact problem since you didn't post your code or provide an area to view it. What I did was:
In html.pl if you built the option select box using a page designer software replace those lines using a text editor with a line like ---
<TD HEIGHT="25"> |; print &build_select_field ("color", "$rec{'color'}"); print qq|</TD>
then in your defualt.cfg file change your db_def area change or add a variable like:
color => [48, 'alpha', 0, 255, 0, '', ''],
(my color variable happens to be variable "48") also read Alex's setup readme carefully -- you can figure out what he's talking about -- I did at least Smile (took me a while though)
and later on in the default.cfg add or change the variable declaration to something like:
color => 'White,Red,Blue,Purple,etc',
Becareful of the last comma (if it's in the beginning or somewhere middle of your select field declarations you need the ending comma, IF IT'S LAST variable take off the last comma)
Your syntax problem could just be having or having the last comma ....

I hope this helps (PS I still don't jack about this stuff)

side note: I hope I explained this correctly Smile
Quote Reply
Re: Select option not operating in HTML.pl In reply to
Sorry folks still having probems, thanks its nice to know there are people trying to help. My line in the html.pl file is as follows
<TD VALIGN="TOP"> |; print &build_select_field ("Category", "$rec{'Category'}"); print qq|</TD></TR>

My line in my config file is as follows

%db_select_fields = (Category => 'Entertainment,Computers,Tourism,Media,Sport,Science,Hobbies,Personal Home Pages,Misc,Business,Leisure',

);

The error message is as follows:-

CGI ERROR==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: syntax error at web_html.pl line 61, near "E

This is a sub file I have renamed web.cfg and web_html.pl as I am trying to start a small database for local sites where I live in N Ireland, I am also using the script for another database, but this one does not need much modifications.

Any help is really appreciated as it is now 3.53am and I start work in just over 4 hours time. Once again many thanks
Quote Reply
Re: Select option not operating in HTML.pl In reply to
The best thing I can suggest is to make your file available (in a text file) on your website and then post the URL for it here. All you need to do is copy the file to an accessible area of the web and name it something like "webhtml.txt." Then come back here and post the URL. Somebody (probably a number of somebodies) will take a look at it and see if they can find the problem.

If you're getting a "not compiling" error, especially one that mentions a syntax error, it's probably not a problem with the select field.

Hope you got some sleep! Smile


------------------
JPD
Quote Reply
Re: Select option not operating in HTML.pl In reply to
Hey DC,

2 possible problems:
1.) you got a closing </TR> on the line ... does it have a <TR> a line or 2 above it?
2.) You seem to have only 1 select field, yes? If yes, then take off the very last comma. That should do it for you. If not then follow JPDeni's advice and she'll probabaly get that baby of your's up and running in lickety split time --- She's great, trust me! She's been helping idiots like me for a while.
quote"%db_select_fields = (Category => 'Entertainment,Computers,Tourism,Media,Sport,Science,Hobbies,Personal Home Pages,Misc,Business,Leisure',
);"
I'm takling about the comma after ,Leisure', <= right here!

Good luck
Quote Reply
Re: Select option not operating in HTML.pl In reply to
Sorry folks tried these but I am now that confused because I was trying things myself, I have put everything back and tried it no luck.

I have posted the two files as follows:

web_html.pl is now:-

Http://www.wincamcs.com/web_html.txt

web.cfg is now

Http://www.wincamcs.com/web.txt

Please forgive the site I am trying to build it up at present, will not be totally working for another few weeks

Again many many thanks
Quote Reply
Re: Select option not operating in HTML.pl In reply to
Found it! Smile

The problem is in the line

$html_title = 'WinCam's N Ireland Search';

You have an apostrophe within the text and single quotes (apostrophes!) around the text. Poor ol' Perl gets confused when things like that happen.

Change it to

$html_title = "WinCam's N Ireland Search";

and you'll be all set -- at least as far as this problem is concerned. Smile



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

PS One thing I noticed in your .cfg file that a lot of people forget. You don't have a userid field, so you should set $auth_user_field to -1. It probably won't cause any problems, since you don't have a field number 9, but I always like things to be neat. Smile

[This message has been edited by JPDeni (edited February 25, 1999).]