[Gllug] webalizer and dynamic pages (C question)
Alex Hudson
home at alexhudson.com
Fri Nov 2 15:17:18 UTC 2001
On Friday 02 November 2001 3:14 pm, you wrote:
> /* strip query portion of cgi scripts */
>
> cp1 = log_rec.url;
> while (*cp1 != '\0')
> if (!isurlchar(*cp1)) { *cp1 = '\0'; break; }
> else cp1++;
> if (log_rec.url[0]=='\0')
> { log_rec.url[0]='/'; log_rec.url[1]='\0'; }
Change isurlchar() (I presume this is a function or a macro). You want to
include '?', '=' and '%' as valid characters, but make sure '&' isn't.
This assumes the first passed variable is what defines a 'page' - if this
doesn't hold (and it doesn't, necessarily) you need to parse the url to look
for [?|&]page=([isurlchar]+)[&]?.
Cheers,
Alex.
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list