Note that there are some explanatory texts on larger screens.

plurals
  1. POpagination outputting to disable a link after clicking a page
    primarykey
    data
    text
    <p>hello i have a code the next previous and last page are working but i can't get the link for the pages to work where the page will be disabled when you go there . i tried changing some parts but when i tried it there's no error simply all of the page number is disabled</p> <p>here's my php code the last part only can't fix it tried but i'm still really a beginner </p> <pre><code> echo "&lt;center&gt;" . $numrows . " search results found&lt;/center&gt;"; echo "&lt;center&gt;"; if ($pages &gt;=1 &amp;&amp; $page &lt;= $pages) { if($page == $first_page){ echo "Previous "; } else{ if(!isset($page)){ echo "Previous "; }else{ // But if page is set and it's not 1. $previous = $page-1; echo "&lt;a href='?page=".$previous."&amp;q=".$searchtext."'&gt;Previous&lt;/a&gt; "; } } for ($x=1; $x&lt;=$pages; $x++) { echo ($x == $page) ? '&lt;strong&gt;&lt;a href="?page='.$x.'&amp;q='.$searchtext.'"&gt;'.$x.' &lt;/a&gt;&lt;/strong&gt;' : '&lt;a href="?page='.$x.'&amp;q='.$searchtext.'"&gt;'.$x.' &lt;/a&gt;' ; } if($page == $last_page){ echo "Next "; }else{ // If page is not set or it is set and it's not the last page. if(!isset($page)){ $next = $first_page+1; echo "&lt;a href='?page=".$next."'&gt;Next&lt;/a&gt; "; }else{ $next = $page+1; echo "&lt;a href='?page=".$next."'&gt;Next&lt;/a&gt; "; } } echo "&lt;a href='?page=".$last_page."&amp;q=".$searchtext."'&gt;Last page&lt;/a&gt;"; } echo "&lt;/center&gt;"; </code></pre> <p>the </p> <pre><code> for ($x=1; $x&lt;=$pages; $x++) { echo ($x == $page) ? '&lt;strong&gt;&lt;a href="?page='.$x.'&amp;q='.$searchtext.'"&gt;'.$x.' &lt;/a&gt;&lt;/strong&gt;' : '&lt;a href="?page='.$x.'&amp;q='.$searchtext.'"&gt;'.$x.' &lt;/a&gt;' ; } </code></pre> <p>part is the one i use to output the pages don't know the configuration for the isset of that part.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload