• how can I create a simple go to jump form?

    user sees “page” and input text form,
    enters number 3.
    hits GO…. and is led to page 3.
    (need to do this for home page, category, tag, and search pages).

    I got this far.

    function goto_page($r){
    $str = 'https://xxx.com/c/4-sale/salvage-architectural/page/10';
    $chars = preg_split('/page/', $str);
    echo($chars[0] .'page/' . $r);
    }
    if (isset($_POST['goto_Page'])) { goto_page() ; }
    echo '<form name="goto" method="post" action="">';
    echo 'Go to Page <input type="text" size="3" name="goto_Page"><br>';
    echo ' <label>
          <input type="submit" name="button" id="button" value="Go">
        </label>
      </p>
    </form>';

    so how do I get the input named “goto_Page” into the variable $r ?

    The variable $str will be picked up from the URI the user is on.

    Any help appreciated.

Viewing 1 replies (of 1 total)
  • try changing this:

    if (isset($_POST['goto_Page'])) { goto_page() ; }

    to this:

    if (isset($_POST['goto_Page'])) {
      $pagefrominput = $_POST['goto_Page'];
      goto_page($pagefrominput);
    }

    to pass the value from your input field on the form to that function.
    I have not tested this but that piece looks like it is missing

Viewing 1 replies (of 1 total)
  • The topic ‘pagination, JUMP to page xx’ is closed to new replies.