Gossamer Forum
Home : Products : DBMan : Customization :

serching with todays date

Quote Reply
serching with todays date
Is there a way to perform searches with the date of today. I would like to use a search from a link that returns events for today & coming dates.

I've searched the forum but haven't found anything that could help me.
Quote Reply
Re: serching with todays date In reply to
Try a link something like this for today search. This checks the date field but if you use the date format in other fields change "&Date" to what ever field you want to search.

Code:
print qq| <a href="$db_script_url?db=$db_setup&uid=$db_uid&Date=|;
print &get_date;
print qq|&view_records=1">Today</a>
Uses format: 05-Mar-2000 to search
Hope this helps.
Dave T


[This message has been edited by Dave T (edited March 05, 2000).]
Quote Reply
Re: serching with todays date In reply to
thanx, Dave T

I tried it but could't get it to work, I tried replacing $db_setup with the db name and $db_uid with the default user id. I also tried other ways og "getting it to work", but no luck.

This search returned a complete listing of the database.

Also (if it's not asking to much) I would prefear a way to perform this search from an link in an html page "outside" (not in html.pl) of dbman.

Quote Reply
Re: serching with todays date In reply to
Well, if you want it on an external web page, you will have to use SSI to do this.

Try the following:

1) Create a script called today.cgi, like the following:

Code:
#!/usr/local/bin/perl
# Link for Today's Records

$days = 2;
$time = time() - ($days * 86400);

my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = loc
altime($time);
my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
($day < 10) and ($day = "0$day");
$year = $year + 1900;
$new = "$day-$months[$mon]-$year";

print qq|<a href="http://www.yourdomain.com/cgi-bin/dbman.cgi?db=default&uid=default&ww=on&Date-gt=$new&$db_key=*&view_records=1">View Today's Records</a>|;

2) Save this file as .pl or .cgi depending on if you are using .pl or .cgi files.

3) Then upload the file to the directory where your DBMAN files are located.

4) Change the permission of this file to 755 (rwxr-xr-x).

5) Then link this file in a web page that allows SSI (like a .shtml file), in the following manner:

Code:
<!--#exec cgi="/cgi-bin/dbman/today.cgi"-->

Hope this helps.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by AnthroRules (edited March 07, 2000).]