Jump to content

Vertical position after a page refresh


Azraeliitti
 Share

Recommended Posts

I am working to enhance this commercial website link removed (it's in finnish). There are lots of categories on the website that can take over 2 pages to scroll after they've been opened and I've noticed it being really annoying when every time you open a category, it refreshes the page and throws you back into the top of the page. I don't have much experience with PHP, so does anyone know how to fix this issue?

Link to comment
Share on other sites

Any variable can be passed over to the next page, in various ways.You van change the links to page.php?variable=value, to have the variable directly passed over and available in the $_GET['variable'] global var.Also, via the post method. Make a form, in which each variable has an input element, when submitted, the vars will be posted on the next page. Same use of as with the GET, but when using such form, use $_POST['variable'] instead. There are more ways, but these are the easiest. When you need something else, think about storing in a database, or using cookies :)

<a href="nextpage.php?screenwidth=1024">Next</a>
(available: $_GET['screenwidth'] = "1024", tutorial: php_get)
<form action="nextpage.php" method="post"><input type="hidden" name="screenwidth" value="1024" /><button type="submit">Next</button></form>
(available: $_POST['screenwidth'] = "1024", tutorial: php_post) Edited by Dan The Prof
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...