Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Very frustrated newbie...

Quote Reply
Very frustrated newbie...
Hi,
I recently purchased DBMan SQL for an online game I run. Our players have been wanting a more automated system, and after much searching a decided to use their donations and purchase DBMan SQL after seeing it do wonders with another such game.

My problem is that I've got a mental block about dealing with it. I read the manual, and I've installed it sucessfully, created a table, etc. etc., but I cannot for the life of me figure out how to make anything look and act the way I want it to, expecially forms. The only one I've tried working with is the "add_form" for adding information to a table - and so far no dice. I can sort of make it look ok using a combination of my own HTML code and the command Dbsql :: HTML:: generate_ add_ form, but it's still not what I'm looking for. Not to mention I can't get it to add the logged in member's name and e-mail address automatically..

This is what I'd like to see:


This is what I get with form generation:


According to the avaliable data, I should be able to make it look and act as I wish using simple HTML, which I'm well versed in. The problem is, I can't do it!

A little help? Maybe someone could talk me though the ropes?
Quote Reply
Re: [Merrie] Very frustrated newbie... In reply to
Hi,
Don't try to mix your custom html with the auto generated stuff.
Just remove the
<%Dbsql::HTML::generate_add_form%> (or ALL the default html)
from your add_form.html and replace it with your own html.
You should be able to display the username using <%Username%> and the email by using <%Email%>
and you can use hidden fields to add them to your table -
<input type="hidden" name="Username" value="<%Username%>">
<input type="hidden" name="Email" value="<%Email%>">


To find out what tags you have available in your template, put the following in your template and load the page.
<%GT::Template::dump%>

Hope that helps.
Simon.
Quote Reply
Re: [jai] Very frustrated newbie... In reply to
Thanks for the reply.. I tried to replace the whole thing with my own form HTML - the problem is that now nothing will write to the database when I use the form. I've been using <form name="register" action="db.cgi" method="post" >, and I'd assume that's where I'm going wrong. If that is the case, what do I need to use.

I'm also having issues with the login aspect of the site - as in, when I login from my index.html page it gives me an error saying ": Error Invalid database requested (Def file does not exist)", but if I login from my login.html file, it allows me to move on.
Quote Reply
Re: [Merrie] Very frustrated newbie... In reply to
Try adding the following to your add_form.html -
<form name="myform" action="db.cgi" method="post" enctype="multipart/form-data">

and make sure you have the following hidden fields -
<input type="hidden" name="do" value="add_record">
<input type="hidden" name="db" value="<%db%>">



As far as the login goes, make sure your index.html has the following -
<form method="post" action="db.cgi">
<input type="TEXT" name="Username">
<input type="PASSWORD" name="Password">
<input type=hidden name="do" value="login">
<input type=hidden name="db" value="<%db%>">


Let me know how it goes.
Simon.
Quote Reply
Re: [jai] Very frustrated newbie... In reply to
Thanks so much! The form will now write to the database.. you guys are excellent.

I'm still not able to login though. Perhaps this is because my index.html page is located outside of the cgi-bin? I did replace the db.cgi with cgi-bin/db.cgi, but who knows...