|
|
|
News id
|
59
|
Headline
|
Returning back to an old page
|
Content
|
When you have a custom action, you need to be able to return back to the page you were on before your custom action. The best way to do this is to take the query that was sent to your action:<br /><br /><blockquote><br />$query =& $app->getQuery();<br /></blockquote><br /><br />Do whatever your action was meant to do it, and then when you are ready to return:<br /><br /><blockquote><br />$query['-action'] = some_value_to_replace_the_action<br />$url = $app->url($query).'&--msg='.urlencode('Action Completed');<br />header("Location: $url");<br />exit;<br /></blockquote><br /><br />The reason why you want to overwrite the -action query is because if you don't then it just calls the actions over and over again. The --msg query string variable allows you to display a confirmation message
|
Image
|
(Empty)
|
Date posted
|
Thu Aug 14 22:28:00 2008
|
Posted by
|
noreply@blogger.com (Fong Chun Chan)
|
Status
|
Approved
|
Categories
|
Blog
|
Source id
|
Fong's Blog
|
Source url
|
http://fongxataface.blogspot.com/2008/08/returning-back-to-old-page.html
|
|
|