suchalaugh
suchalaugh

Reputation: 1

Changing browser history in php

i have a webpage, done with php (start.php&number=1)

On this webpage, there is a link to increase the number everytime i click on it. This works perfectly fine. If I click it 99 times, the url is start.php&number=100

Now when i click the back button in my browser or swipe left on my phone, it just goes back to start.php&number=99. Although this is really reasonable, i just want to go back to the page before I visited start.php. For example facebook if I was on facebook before I visited start.php

Is there a way to do this

Upvotes: 0

Views: 130

Answers (1)

Rohit Gupta
Rohit Gupta

Reputation: 4185

You can't change the browser history. But if you don't want the browser to regard the new number as a different page then you need to

  1. Use javascript to increment the number client side only.
  2. Or use an ajax call to increment it at the server and display it at the client by updating a portion of the web page.

Upvotes: 1

Related Questions