Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Paging control and URL parameters

Community Beginner ,
Dec 07, 2009 Dec 07, 2009

Hi there,

Please check out this page:

http://martinique.org/activities/sports.php

Go to the section "Skiing Surfing"

1 - Use the navigation to go through the records.

2 - Take a look at the URL in the browser window.

Now, please go to the section "Hiking" and repeat 1 & 2.

Note that the URL is appending the new parameters instead of replacing the previous one.

What am I doing wrong here.

Please help me to solve this problem.

Thank you much!

TOPICS
Server side applications
562
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 07, 2009 Dec 07, 2009

The code generated by the Dreamweaver recordset navigation bar automatically adds any existing variables to the end of the query string. The following code (just above the DOCTYPE) comes from a recordset navigation bar on one of my pages:

$queryString_listAuthors = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_listAuthors") == false &&
        stristr($param, "tota

...
Translate
LEGEND ,
Dec 07, 2009 Dec 07, 2009

The code generated by the Dreamweaver recordset navigation bar automatically adds any existing variables to the end of the query string. The following code (just above the DOCTYPE) comes from a recordset navigation bar on one of my pages:

$queryString_listAuthors = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_listAuthors") == false &&
        stristr($param, "totalRows_listAuthors") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_listAuthors = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_listAuthors = sprintf("&totalRows_listAuthors=%d%s", $totalRows_listAuthors, $queryString_listAuthors);

I haven't tested this, but to eliminate the extra variables in the query string, comment out the whole of the if statement like this:

$queryString_listAuthors = "";
/*
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_listAuthors") == false &&
        stristr($param, "totalRows_listAuthors") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_listAuthors = "&" . htmlentities(implode("&", $newParams));
  }
}
*/
$queryString_listAuthors = sprintf("&totalRows_listAuthors=%d%s", $totalRows_listAuthors, $queryString_listAuthors);

You will need to do that for each of your recordset navigation bars.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 07, 2009 Dec 07, 2009

It works!

Thank you very much David!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 08, 2009 Dec 08, 2009
LATEST

Good. I was fairly confident that it would solve your problem, but didn't have the time to run any tests. Thanks for letting me know.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines