automating page navigation and control transfer

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there a system  available to do the following:
consider an app of a few pages:



when I am at page3.php, I do not know whether I came there from
page1->form1 or page2->form3.
I can check for $_SERVER['HTTP_REFERER'] and get an answer. But this
example is simple. Let us generailze that I want an app that keeps a
track of all the pages the user requested, in the order that they were
sent to him.

Obviously, it can be written based on sessions. Is there already some
popular open source application for this?

Also, this brings me to a broader question of page navigation rules. In
an app made of 20-50 pages/scripts, life will be hell if there is no
systematic approach to transferring control between pages. Is there
some kind of structure already made and readily available into which
you just plug-in your pages by telling some rules ?

E.g. the scheme is something like:
$ListOfPages = array(

$RuleSet = array(
The RuleSet is a set of page transfer rules based on evaluation to true
of the specified functions, i.e., allow_edit(), allow_add(),
my_error_handler() etc.
Obviously, form submission is the chief means of control transfer for
PHP programs and the use of ?op=add_something in URL's(GET) and <input
type=hidden name=op value=add_something> (POST) are a step towards
making some kind of structure.

So the grand code will look like:
$MyGrandAppControllerObj = new GrandAppControllerObj();

Any links to discussions of this kind or apps or pages that do
something like this ?

Re: automating page navigation and control transfer

Quoted text here. Click to load it

Here's one idea:  Use mod_rewrite (or equivalent on IIS) to redirect all  
requests for the contents of a certain directory (or entire site) to a  
single PHP script.  Use the original request (sent through the REQUEST_URI  
header on apache, or similar header with ISAPI rewrite) to determine what  
URI was requested, to figure out which script to run.  Make your code  
light-weight enough (caching, etc.), and you'll not notice a performance  
hit.  It's ridiculously easy to implement cross-site templating, without the  
explicit tying-in of templates with a specific templating engine.


Re: automating page navigation and control transfer

Hi dave,
d wrote:
Quoted text here. Click to load it

thanks for the reply.
what I was looking for was a "PHP framework".
There are quite a few of them around, mostly open source, I got them by
just googling
BlueShoes, Seagull, php.MVC, AjaxAC, lots basically.

Most of my questions are answered.

thanks anyway.

Re: automating page navigation and control transfer

Quoted text here. Click to load it

That's essentially all those frameworks are :)  If you want to use one off  
the shelf, then you'll miss out on a lot of fun ;)  

Site Timeline