Gossamer Forum
Home : Products : DBMan : Installation :

Default user logon and search problem

Quote Reply
Default user logon and search problem
Hi

I have put a search field on the main menu page using this sub routine:

Code:
sub html_search {
# --------------------------------------------------------
# Basic search form.
#
print qq~
<h2>Search:</h2>
<form action="$db_script_url" method="get">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<div class="margin">
<$table>
<tr><td class="formcell" colspan="2"><strong class="search">Search $html_title:</strong></td></tr>
<tr><td class="formcell"><input type="text" name="keyword" size="15" maxlength="255"></td><td class="formcell"><input type="submit" name="view_records" value="Search"></td></tr>
<tr><td class="formcell">~;
print qq!<small class="more"><a href="$db_script_link_url&view_search=1">More search options</a></small>! if ($per_view);
print qq~</td></tr>
</table>
</div>
</form>

~;

}

When one arrives at this page from this link:

Code:
<a class="menulink" href="/citinet-cgi/db/db.cgi?db=courses&uid=default" title="CITINET Courses" onMouseOver=" window.status='CITINET Courses'; return true" onmouseout="window.status=''; return true">Courses</a><br>

And does a search using this form they get the DB unknown action page:

Code:
http://citinet/citinet-cgi/db/db.cgi?db=courses&uid=default&keyword=web

However if they try another search it works.

I think I have messed up the UID ULR somewhere - can anyone sopt what I have done wrong?

Thanks

Chris
Quote Reply
Re: Default user logon and search problem In reply to
It shouldn't matter. All the script tests for is to see if "view_records" equals something. It can be anything.

However, I always hate to have that kind of mystery hanging around. I'd love to help you figure it out, but you're using new-fangled stuff that I just don't understand.


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





Quote Reply
Re: Default user logon and search problem In reply to
You need to add

&view_records=1

somewhere in your URL.


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





Quote Reply
Re: Default user logon and search problem In reply to
Hi

Thanks JD, this works, but for some reason if another search is done I end up with this url:

Code:
http://citinet/citinet-cgi/db/db.cgi?db=courses&uid=default&view_records=1&keyword=web&view_records=Search

with &view_records= with two different values - does this matter?

Chris