PHP Help - I must be over looking something

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

jdk

VIP Member
Impact
98
[RESOLVED] PHP Help - I must be over looking something

I have been staring at this since last night and for some reason I must be overlooking something. I have had no problems in the past but for some reason this one is has me stumped.

Code removed b/c project has not officially been released I am working on.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
Replace this line

PHP:
                                    $pageprev = $page=$page-1;

With this
PHP:
                                    $pageprev = $page-1;

and
PHP:
                                    $pagenext = $page=$page+1;

With this
PHP:
                                    $pagenext = $page+1;

In both cases you're inadvertently setting $page in the code along with $pageprev and $pagenext.

Note that the second case ($pagenext) doesn't manifest an error for you because you no longer access the $page variable after that code. But it's a logic error nonetheless, and one day you might just need to access $page somewhere after creating the prev/next links.
 
1
•••
Thanks I also had to remove the
PHP:
$page++;
I must have added in there.
 
0
•••
Ah yeah. I commented that out in the test code as well and forgot to mention it.
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
URLs.com
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back