Gossamer Forum
Home : Products : DBMan : Installation :

Question on URL/CGI command syntax

Quote Reply
Question on URL/CGI command syntax
Hello

My implementation of DBMAN is nearly completed. I have (with the help of Alex and JPDeni) been able to get my Alumni database up and running in a MUCH better format than my original HTML/Guestbook implementation.

One thing remains until I take it from BETA on my site to production, and here it is:

How can I, in a link, select records if there is a URL present in the database?

The application is this - I have a link on my main alumni page that takes Alumni to a page which shows all Alum who have a webpage. Presently, I have to manually update the page whenever someone signs up. What I would like to do is make that dynamic - i.e. user selects the link, it goes out, searches and selects all Alumni with a web page, returns results on a spreadsheet format. The ONLY piece of this NOT working is the syntax to pull all records based on URL being present.
(I do not have a default for the field, so if the user does NOT enter the URL, the field is blank)

Actually, now that I think about that, there is another part to that - I want the HTML formatted differently for this than my normal spreadsheet format. I'd like to give the user the ability to enter their URL title as well and for the resulting search to show their URL title and their name and class year, with the URL title being an HTML link to their site.

I'm already capturing the URL as an HTML link in my DBMAN implementation, its just the selecting from a link that is a problem for me (well, that and the alternate view).

BTW, I am using Default User to allow this to work without login.

The syntax I have attempted for the link is this:

a href=$db_script_url?db=alumni&uid=default&view_records=1&URL={ What do I put here? }


Thanks in advance for any assistance.

Jamie


------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX
Quote Reply
Re: Question on URL/CGI command syntax In reply to
 
Quote:
a href=$db_script_url?db=alumni&uid=default&view_records=1&URL={ What do I put here? }

If you don't have a default value for the URL, it should work just to have

URL=*



------------------
JPD
Quote Reply
Re: Question on URL/CGI command syntax In reply to
 
Quote:
If you don't have a default value for the URL, it should work just to have

URL=*

Except that will return everything, he only wants one where URL is not null (* matches even on blank records).

Instead, try:

URL=http

(assuming they all start with http://) or:

URL=.+&re=1

where it will match any URL that has at least one character.

Hope that helps,

Alex
Quote Reply
Re: Question on URL/CGI command syntax In reply to
The URL=http works.

Now, for the second part of my question.
How can I create a specific view for just this purpose? I only want to use it as a link from an html table. I guess if I could also make it accessible from within dbman that would be ok, but the main purpose is for linking from the table, which is outside dbman.

Thanks for all your help, both of you!




------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX
Quote Reply
Re: Question on URL/CGI command syntax In reply to
You can pass any variable you want (or just about) from the URL.

Let's say you had a specific html_record subroutine that you only wanted to be displayed sometimes. In the URL, include all the normal stuff, plus another variable. Let's call it "foo." So in your URL you would include

&foo=1

Then in html_view_success, where it calls the html_record subroutine, add

Code:
if ($in{'foo'}) {
&html_record_foo (&array_to_hash($_, @hits));
}
else {
&html_record (&array_to_hash($_, @hits));
}


BTW, I guess I didn't know as much as I thought I did about DBMan! Smile



------------------
JPD
Quote Reply
Re: Question on URL/CGI command syntax In reply to
Thanks Alex and JPDeni for all your help. I got this working last night, and it is GREAT!



------------------
James A. (Jamie) Dennis
*Certified AIX Administrator
*Certified Solaris Administrator
*Member - SAGE, USENIX