Gossamer Forum
Home : Products : DBMan : Installation :

changing fields in DBman on NT server

Quote Reply
changing fields in DBman on NT server
To any one that can help,

This is my second posting of the day. I have an nt iis 3.0 machine at home which serves as a practice machine I'm running active Perl 517 and am looking at dbman as a basis for several database study projects.

I want to completely modify the demo to a simple database that contains a few fields.

1. Including one that stores <img src=""> tag to pull up graphics. How can this attribute be added to a field automatically or perhaps hidden to the user, so that a user when doing input or seraching requires only to enter the file name of the jpg image.

2. When doing whole sale changes to fields of dbman, I figures changes should be made in cfg, html and the db files, am I on the write track.

I have seen the upload file information by JPDeni I don't know if this is really what I need. because I have tested an image tag in a field and found that it works just fine.

I want the graphics to load only one per record and during search results or views.

------------------
Peter Filopoulos
http://www.tc4.com/
admin@tc4.com
Quote Reply
Re: changing fields in DBman on NT server In reply to
I'm not sure what it is exactly that you want to do with your image files. If the images are on your server, and all of them are .jpg, you can have a field that just holds the name of the file. For example, if a .jpg which is associated with a given record is "fred.jpg" and your graphics files are in the directory
http://www.server.com/graphics/
you could have a field called "Graphic" which, for this record would have a value of "fred." When you display the record you would use

<img src="http://www.server.com/graphics/$rec{'Graphic'}.jpg">

Does that help?

If you are changing the fields in DBMan, you need to change the .cfg file to reflect the changes. After you create your new fields, run it with $db_autogenerate = 1 to make sure that there aren't any problems with your field definitions. (Things won't look like you want them to, probably, but it's easier to find problems if you make small changes.)

Once you know your fields are working okay, edit the html.pl file, subs html_record_form and html_record to reflect the way you want your pages to look.

Unless you have major changes to make in the actual working of the script, you probably won't need to do much with the db.cgi script.

The image upload mod allows users to upload their images to your server. It eliminates the need for the separate "Graphic" field I mentioned above by naming the graphic to match the key value of the record. You can certainly make the script work without it, though. You'll just need to have users send you their graphic files and you can install them on your system yourself.

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





Quote Reply
Re: changing fields in DBman on NT server In reply to
Thanks for the information,

I guess I was thinking it was far more complicated. I will set it up.

Also, now I realize what the upload_file is for, I may want to do something like that in the future.

------------------
Peter Filopoulos
http://www.tc4.com/
admin@tc4.com