473,654 Members | 3,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

automating page navigation and control transfer

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

page1.php:
form1----->page3.php
form2----->page4.php

page2.php:
form3----->page3.php
form4----->page4.php

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(
1=>"Main.php",
2=>"Edit.php",
3->"Add.php",
..........,
N->"Error.php") ;

$RuleSet = array(
1=>array("Main. php","Edit.php" ,"allow_edit "),
2=>array("Main. php","Add.php", "allow_add" ),
............... ....
3=>array("Main. php","Error.php ","my_error_han dler")
);
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_handle r() etc.
Obviously, form submission is the chief means of control transfer for
PHP programs and the use of ?op=add_somethi ng in URL's(GET) and <input
type=hidden name=op value=add_somet hing> (POST) are a step towards
making some kind of structure.

So the grand code will look like:
$MyGrandAppCont rollerObj = new GrandAppControl lerObj();
$MyGrandAppCont rollerObj->setPages($List OfPages);
$MyGrandAppCont rollerObj->setRules($Rule Set);
$MyGrandAppCont rollerObj->Run();

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

Feb 7 '06 #1
3 2552
d
"Joseph S." <js****@rediffm ail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Is there a system available to do the following:
consider an app of a few pages:

page1.php:
form1----->page3.php
form2----->page4.php

page2.php:
form3----->page3.php
form4----->page4.php

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(
1=>"Main.php",
2=>"Edit.php",
3->"Add.php",
.........,
N->"Error.php") ;

$RuleSet = array(
1=>array("Main. php","Edit.php" ,"allow_edit "),
2=>array("Main. php","Add.php", "allow_add" ),
............... ...
3=>array("Main. php","Error.php ","my_error_han dler")
);
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_handle r() etc.
Obviously, form submission is the chief means of control transfer for
PHP programs and the use of ?op=add_somethi ng in URL's(GET) and <input
type=hidden name=op value=add_somet hing> (POST) are a step towards
making some kind of structure.

So the grand code will look like:
$MyGrandAppCont rollerObj = new GrandAppControl lerObj();
$MyGrandAppCont rollerObj->setPages($List OfPages);
$MyGrandAppCont rollerObj->setRules($Rule Set);
$MyGrandAppCont rollerObj->Run();

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


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.

dave
Feb 7 '06 #2
Hi dave,
d wrote:
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.

dave


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 http://www.google.com/search?q=PHP+framework
BlueShoes, Seagull, php.MVC, AjaxAC, lots basically.

Most of my questions are answered.

thanks anyway.
Regards,
JS

Feb 9 '06 #3
d
"Joseph S." <js****@rediffm ail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hi dave,
d wrote:
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.

dave


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 http://www.google.com/search?q=PHP+framework
BlueShoes, Seagull, php.MVC, AjaxAC, lots basically.

Most of my questions are answered.

thanks anyway.
Regards,
JS


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 ;)
Feb 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
12848
by: Limey Drink | last post by:
Hi all, Firstly :-) , is there any where I can search through archived newsgroup posts so I am not cluttering up the newsgroup with repeated queries ? And secondly :-), I know this has probably been discussed before but. I am wanting to do some scripting to automate a few administration tasks, one of the first tasks is automating FTP file transfers.
22
5134
by: Jonathan Snook | last post by:
I've been contemplating what the recommended usage of a "top of page" link should be? Should there only ever be one at the bottom of the page? Should they be sprinkled at various points on the page? Or should they be used at all? Lately, I've been leaning towards the last option because my thought is that most browsers have a method to make it back to the top of the page (home button, scroll bar, whatever). It seems I never use the...
4
3343
by: jim | last post by:
I new with .net and asp. I can't find a way to link a asp page from a asp.net page. I have tried a button and even a simple hyper link is not working. When I click the hyper link in asp.net(in the navigateUrl I have an asp page), it let me down load the asp file. Can anybody help me? Jim
3
1089
by: Mohamud Faruk | last post by:
I am writing a web based application using ASP.Net. As part of the application flow I am calling several web forms and the user can navigate between different forms. Currently I am aware of Server.Transfer(" .aspx") and Response.Redirect(" ..aspx") statements. 1.Is there any other statements that I can use other than these. Is there any other way I can use navigation between web forms? 2. I have a difficulty of retaining the values...
4
2164
by: Manuel Lopez | last post by:
Hello, I need to know on evry request the page name, my problem is when use the method server.transfer, i always get the name of the calling page. I use context.Current.Request.Url, but I am always getting the first page. Is there a way to get the name of the transfered page?
3
1899
by: venky | last post by:
Hi, I have a question regarding page navigation. See i have a page called page1.aspx and page2.aspx. On some event in the both the pages the page get transfered to page3.aspx using Server.Transfer method. One i i hit the update button in the page3, i want to go back to the previous page which can be either page1 or page2.
5
1797
by: Amelyan | last post by:
I am struggling here trying to determine what is a good programming practice as far as referencing your URLs. When you use Response.Redirect, do you use 1) Hard-coded string -- Response.Redirect("MyPage.aspx"); 2) Constants -- Response.Redirect(STRMyPage); // where input parameter is -> const string STRMyPage = "MyPage.aspx"; 3) Something entirely differnent?
15
4752
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
0
1125
by: Dan | last post by:
I have a datagrid in ASP.NET 1.1 When selecting a particular row, it should divert to another aspx page and allow me to edit details about that selected row. What do people feel is the best practise for page navigation? I'm of the opinion that query string usage via hyperlinks isn't as secure as post methods via forms, as people could easily amend the url in their browser address bar?
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.