Jabop Posted July 7, 2008 Share Posted July 7, 2008 MaintainScrollPositionOnPostback=true In ASP, if a postback is called it will return the browser to the same location. Can someone give me the PHP equivalent of this? Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/ Share on other sites More sharing options...
discomatt Posted July 7, 2008 Share Posted July 7, 2008 I'm not sure what you want to do... did you want to parse the submitted data then return to the form page? Or redirect to the form page carrying the post data with you? Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583637 Share on other sites More sharing options...
gigas10 Posted July 7, 2008 Share Posted July 7, 2008 <?php echo $_SERVER['PHP_SELF']; ?> Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583638 Share on other sites More sharing options...
discomatt Posted July 7, 2008 Share Posted July 7, 2008 Oh, i see what you want to do here, i think. Isn't this a client-side effect? I'm not sure PHP can do this. It might be possible with anchors in the action attribute, but once again this is client-side. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583640 Share on other sites More sharing options...
Jabop Posted July 7, 2008 Author Share Posted July 7, 2008 I thought it was something like: <?php header('Cache-Control: something goes here blah'); header('Pragma:'); ?> Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583652 Share on other sites More sharing options...
discomatt Posted July 7, 2008 Share Posted July 7, 2008 From what I've read, there's no pure-php way to do this. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583665 Share on other sites More sharing options...
trq Posted July 7, 2008 Share Posted July 7, 2008 MaintainScrollPositionOnPostback=true In ASP, if a postback is called it will return the browser to the same location. Can someone give me the PHP equivalent of this? That is a client side behavour, you will need to look at Javascript. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583667 Share on other sites More sharing options...
Jabop Posted July 7, 2008 Author Share Posted July 7, 2008 There is no way to achieve it with headers? Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583671 Share on other sites More sharing options...
discomatt Posted July 7, 2008 Share Posted July 7, 2008 I don't beleive there's a standard header to replicate this function Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583674 Share on other sites More sharing options...
Jabop Posted July 7, 2008 Author Share Posted July 7, 2008 <?php header('Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0'); header('Pragma:'); header('Expires: '.gmdate('D, d M Y H:i:s', time()+(2*60*60)).' GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); ?> Found a snippet. This works, not sure how though. I will do some testing. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583675 Share on other sites More sharing options...
trq Posted July 7, 2008 Share Posted July 7, 2008 <?php header('Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0'); header('Pragma:'); header('Expires: '.gmdate('D, d M Y H:i:s', time()+(2*60*60)).' GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); ?> Found a snippet. This works, not sure how though. I will do some testing. That stops the page from caching, nothing to do with scroll location. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583701 Share on other sites More sharing options...
Jabop Posted July 7, 2008 Author Share Posted July 7, 2008 Strange, it makes the scrollbar go back to the location when you do postback Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583718 Share on other sites More sharing options...
trq Posted July 7, 2008 Share Posted July 7, 2008 Hehe, an odd side effect I should imagine. Link to comment https://forums.phpfreaks.com/topic/113591-php-equivalent-of-asp-scrollbar-location/#findComment-583728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.