close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

pagination update

Thread began 6/16/2015 8:22 am by Jamie | Last modified 6/19/2015 10:49 am by Ray Borduin | 3619 views | 18 replies |

Jamie

pagination update

Hi Ray

I have a results page which spans a number of pages and I use the pagination to navigate through it.

If, for example, I was on page 4, select an item from that page to update and then click update, what do I need to put in the update record 'go to' to automatically go back to page 4 (rather than the starting page)?

The url looks like practicebrands_results.php?pageNum_WADAbrands=3&totalRows_WADAbrands=102

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

Save the value of $_GET['pageNum_WADAbrands'] on the results page as a session variable on top of the page. Then you can pass it back in the url after updating to return to that page.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

OK

I think I have set the session on the results page

<?php
@session_start();
if (!isset($_SESSION["BrandsPaginationReturn"])) {
$_SESSION["BrandsPaginationReturn"] = "".$_GET['pageNum_WADAbrands'] ."";
}
?>



Is that right?

Then on the update page, I am struggling to construct the redirectURL in the server behaviour update record

At the moment I have

$WA_redirectURL = "practicebrands_results.php".$_SESSION['BrandsPaginationReturn']  ."";



What am I doing wrong?

Sign in to reply to this post

Ray BorduinWebAssist

Your trigger for setting the session variable is wrong... it should be:

if (isset($_GET['pageNum_WADAbrands'])) {

Then make sure on your update page you are starting the session on the top:

<?php
@session_start();
?>

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

cheers Ray...

the session_start on the update page, is that it or do I need to reference anything? If thats it, the URL I have is still not redirecting back to the right page...just goes to the first page of the results.

Sign in to reply to this post

Ray BorduinWebAssist

The redirect needs to add the parameter name too:

$WA_redirectURL = "practicebrands_results.php?pageNum_WADAbrands=".$_SESSION['BrandsPaginationReturn'] ."";

did you update the trigger on the result page as I recommended?

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

Yes, changed it to

<?php
@session_start();
if (isset($_GET['pageNum_WADAbrands'])) {
$_SESSION["BrandsPaginationReturn"] = "".$_GET['pageNum_WADAbrands'] ."";
}
?>



have changed the redirect url as you have suggested

$WA_redirectURL = "practicebrands_results.php?pageNum_WADAbrands=".$_SESSION['BrandsPaginationReturn'] ."";



Still returning to the first page

Sign in to reply to this post

Ray BorduinWebAssist

What is the URL when it returns you to the first page?

What happens if you write the url to the update page like:

<?php echo("practicebrands_results.php?pageNum_WADAbrands=".$_SESSION['BrandsPaginationReturn'] .""); ?>

Does it look correct?

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

the return url is just practicebrands_results.php

As to the second q, it lacks the ID this is the output onpage: practicebrands_results.php?pageNum_WADAbrands=

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a URL where I can view it? It sounds like the session variable isn't getting set properly.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...