[racket] cgi dynamic link

From: Noel Welsh (noelwelsh at gmail.com)
Date: Mon Nov 1 12:42:05 EDT 2010

On Sun, Oct 31, 2010 at 11:24 PM, scouic <scouic at gmail.com> wrote:
> For example, for create a link to /hello, i have a function
> (lambda (query) '(html (body (div "hey all")))) who, when i'm connecting
> with the browser at localhost:8080/hello, displays "hey all". This is good.
> Now, i have another webpage, /myblog,  who displays the title of all my
> posts. But i don't know how can i "transform" this title into a link that
> would lead me to a page where the title+body would be displayed ...

This is up to you to decide. That is, it is part of the application
design that you must decide on. A typical solution is to have a
parameter to your cgi program that specifies the primary key of the
blog post that you want displayed. For example, say you have a cgi
program called blogpost.cgi. The URL blogpost.cgi?id=1 would display
the blog entry with the id (primary key) 1. You have to write the code
to interpret this parameter in an appropriate way.

HTH,
N.


Posted on the users mailing list.