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? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
gigas10 Posted July 7, 2008 Share Posted July 7, 2008 <?php echo $_SERVER['PHP_SELF']; ?> Quote Link to comment 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. Quote Link to comment 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:'); ?> Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.