Gossamer Forum
Home : Products : DBMan : Customization :

Probably a simple one - (I hope!)

Quote Reply
Probably a simple one - (I hope!)
I am trying to post data to two fields from an external html form and cant figure it out???

I have created a simple form with the form tag
<form method="post" action="cgi-bin/dbman/db.cgi?db=records&uid=default&add_form=1">

I then have two text boxes with names that correspond to two fields defined in my .cfg file. Then in html.pl I have added after my (%rec) = @_; in sub html_record_form
if ($in{'add_form'}) { $rec{'TYPE'} = $in{'TYPE'};}

I get an Unknown Action error when I submit the form. I got all the above tips from a thread where JPDeni helped someone who was trying to post data from normal link tags so I am guessing that mine fails due to the form tag???

Any suggestions would be most welcome.

Thanks in advance,
Mick McG.

Quote Reply
Re: Probably a simple one - (I hope!) In reply to
The first problem I see is how you are logging users in before adding these two fields. The in-box add-form uses db and userid parameters. And it looks like you are not taking that into account.

The second problem I see is that you are not using the correct form syntax...if you want to call the ADD routine within the db.cgi, you will need to add a hidden field to show which action you are taking. Using query stings like you have will not work in the ACTION attribute of the FORM codes.


Eliot Lee