This topic is locked

Returning to list after add or edit

5/5/2008 2:47:01 AM
PHPRunner General questions
S
shoppy author

Hi all,
How do I directly return to the 'list' after I edit or add a field?

Now when I add or edit a field I get the message that I did so but stay in the edit or add area. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=8374&image=1&table=forumtopics' class='bbc_emoticon' alt=':angry:' />
I would like to directly return from adding or editing to the list instead of scrolling down and click "return to list".
Is this possible?
Thanks.
John

J
Jane 5/5/2008

John,
use After record added/After record updated events on the Events tab for this purpose.

Here is a sample:

header("Location: tablename_list.php?a=return");

exit();

S
shoppy author 5/6/2008

John,

use After record added/After record updated events on the Events tab for this purpose.

Here is a sample:


It works! Great, this saves a whole lot of clicking!
Thanks Jane, youre the best. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28893&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />
John

M
mattd1 9/14/2008

Perhaps not the right place to ask this question but I'm a newbie - I've searched elsewhere already.
I need a slightly different security model (dynamic, but delegated to clients for their users). I have a simple table structure for this, very like the existing one, but extended with a user level override.
Anyway, I plan this:

(1) Every page, on load (or when called?) will check if the logged in user has rights to the function. I expect to write a common function that will check a user against the tables and return whether they're allowed access or not (maybe even to extent that it will prevent certain options in the page - like the permissions function in PHPR)
(2) If the user's not allowed access, I want to tell them in a message, and return them to the page they called from. I guess this will be with a header redirecting back.
So:
(1) Is this a sound approach, or is there some better way?

(2) How can I do this - how do I make this generic so I can have on function that effects "send a message, and then send the user back to where they came from"?
Any help is most appreciated.
Thank you.

T
thesofa 9/14/2008

You might get better results if you post this in a new topic!, but see below anyhow..

Perhaps not the right place to ask this question but I'm a newbie - I've searched elsewhere already.

I need a slightly different security model (dynamic, but delegated to clients for their users). I have a simple table structure for this, very like the existing one, but extended with a user level override.
Anyway, I plan this:

(1) Every page, on load (or when called?) will check if the logged in user has rights to the function. I expect to write a common function that will check a user against the tables and return whether they're allowed access or not (maybe even to extent that it will prevent certain options in the page - like the permissions function in PHPR)
(2) If the user's not allowed access, I want to tell them in a message, and return them to the page they called from. I guess this will be with a header redirecting back.
So:
(1) Is this a sound approach, or is there some better way?

(2) How can I do this - how do I make this generic so I can have on function that effects "send a message, and then send the user back to where they came from"?
Any help is most appreciated.
Thank you.



If you use the built in advanced security of PHPRunner, you will be able to do all you descibe.

In fact, if you have a user in a griup of people who are not allowed to Add a Record, the Add button will not appear.

It looks a bit daunting at first but persevere and it really works well.
HTH