advice/techniques: script control over page transitions

2000-04-04 Thread BT

I've generally created a cgi script per page.  Is that a mistake?
(I embed the perl in my html so I can edit pages with an html editor)

I need a better technique for invoking traversals to other pages.
Right now all I can do is a redirect (internal or external).
How do you organize things so that from within a script you can either
display the associated page or invoke any other page/script instead?

- just do redirects?
- put all page generation in subroutines in one big .pm?
- something else (I hope)?


Example:  My main "home" page has links to "login" and "register"
scripts/pages, both of which eventually lead to a "user" page.
With no parameters the login script displays an empty login form.
Called with get/post parameters it processes the form data;
on failure it redisplays the login form with a warning,
on success it should take you to the "user" page (my problem).
How would YOU organize this?

There are lots of tutorials on the net, but I haven't seen anything
about organization between multiple pages. 

(sorry, this is a clarified repost)



cgi script efficiently invoking another cgi script

2000-04-03 Thread BT

Assume you roughly have a one-to-one between scripts and web pages.
How do you write a script to display its own web page or efficiently
invoke another script/page?  Redirect is slow.  Can you exec, i.e.
can a cgi script exec another in it's own place?

For example:
Suppose you write a "login" script/screen in a cgi file, to display
and verify (and possibly redisplay) a web page for login information.
On successful login, you want it to set some cookies and invoke
another script/screen.  A redirect seems extremely inefficient.

I find this situation pops up all over the place.  How do other
people deal with this?  Just redirect?