Gossamer Forum
Home : Products : DBMan : Installation :

how to change database value before output ?

Quote Reply
how to change database value before output ?
Background Information :
I have a database (Win95) program, which can export the entrys to an output HTML file, but the filenames are not ending with .html and they are named different as they are in the database. The database itself can be export as a .txt file to DBMan and it contains the structure and values like this

index article-number text-fields
910010-30-3 240211 text
910010-40-2 345311 text

Now visitors can search for the article and if they enter "240211" i want have than a link with href to the html file no search results. (til here it works.)

These first intern database keys and the external HTML output name are not the same and i must do a convert.

sd910010.303 < html output files
sd910010.402 < html output files

before view result , convert to :

910010-30-3 > sd910010.303.html

that now the visitors can click on it as a href.

Is it possible to convert before output the "-" with "." and remove the last "-" ?

And if i "list all" i got everytime this link :

http://foot.com/sdbank/<B910010.16.2</B<B</B.html>

the source look like this

<a href ="http://foot.com/sdbank/$rec{'ID'}.html">Load here!</a>

If i do a search and got a result than the link is correct. But i cant download the file because it is totaly different named.

This database from the external program changed each week (about 700 entries ) and i not want to convert all the values
each week with hand. Just uploading the new database and the output html files into the dirs which i export before with the Win95 program.

Sorry, if i not describe my problem correct, but i found DBMman as a top refer of database for the WWW site....

Thanks in advantage
Quote Reply
Re: how to change database value before output ? In reply to
If your format is always the same, it shouldn't be too much of a problem. (Gee, I hope I get this right! Smile )

Code:
@ID = split(/-/$rec{'ID'});
print qq|<a href ="http://foot.com/sdbank/sd$ID[0].$ID[1]$ID[2].html">Load here!</a>|;

As for the <B>...</B> problems, set $db_bold to 0 in your .cfg file. It might be nice to have search results bolded, but it causes too many problems.


------------------
JPD
Quote Reply
Re: how to change database value before output ? In reply to
Thank you !!

it works now, only the "," was missing in your help, it must look @ID = split(/-/,$rec{'ID'});