Perfection is elusive :-)

If I understand your question, you want to know how to construct paths from db entries chosen from a cgi query. That is just a matter of building up a string. Select the db rows that match your query, according to your rules, and build the paths from the results.

From your example data, it looks like the path is built from a db record as "$course/$week/$id.$ext". Is the Type associated to the particular url?

If the url is significant to the search, consider making a directory for each, and putting a DirectoryIndex /cgi-bin/searchscript.pl line in each directory's .htaccess file. the searchscript.pl file can grab the url it was called under.

I'd like to see your whole design, what you show here seems slightly clunky.

After Compline,
Zaxo


In reply to Re: Perfect Indexer & Search Engine by Zaxo
in thread Perfect Indexer & Search Engine by YAFZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.