back

Back to previous page with header( “Location: ” ); in PHP

邮差的信 提交于 2019-11-26 21:33:48
The title of this question kind of explains my question. How do I redirect the PHP page visitor back to their previous page with the header( "Location: URL of previous page" ); try: header('Location: ' . $_SERVER['HTTP_REFERER']); Note that this may not work with secure pages (HTTPS) and it's a pretty bad idea overall as the header can be hijacked, sending the user to some other destination. The header may not even be sent by the browser. Ideally, you will want to either: Append the return address to the request as a query variable (eg. ?back=/list) Define a return page in your code (ie. all

How to capture browser's back/forward button click event or hash change event in javascript?

自古美人都是妖i 提交于 2019-11-26 20:59:02
问题 I want to alert() when browser's back or forward button is clicked or hash is changed in javascript. I have tried this solution and it is working but it is causing problems on other links in webpage and submit each request twice on any link click event. Is there any solution to capture it without using setInterval() function? So I need to capture hash change or back/forward button click event? I need a simple javascript code/function/property that should work in all modern browsers. Any

Back button re-submit form data ($_POST)

江枫思渺然 提交于 2019-11-26 20:43:31
My problem is that the back button causes the browser to say something like "Page expired" when the previous page was created by a form. Example: page1: form submitted with search criterias ($_POST request, form points to page2) page2: Receives $_POST request and show result (list of user with links, points to page3) page3: Show user profile Now when the visitor clicks the back button in the browser it will show something like "Page expired". Instead the previous page should be shown with no warnings (page2, with the userlist) How are your strategies to get around this behavior? If you are

jQuery UI Tabs back button history

人盡茶涼 提交于 2019-11-26 17:37:59
问题 Has anyone been able to get jQuery UI Tabs 3(Latest version) working with the back button? I mean if the user hits the back button they should go to the previously visited tab on the page, not a different page. The history plug in sounds like it can work, but i cant seem to make it work with ajax loaded tabs. If anyone has managed to make this work, it would be deeply appreciated, thanks! 回答1: I just ran into this as well. Its really easy with the jquery address plugin here http://www.asual

Prevent Form resubmission upon hitting back button

青春壹個敷衍的年華 提交于 2019-11-26 16:24:45
问题 I have searched many posts here and elsewhere but can't seem to find a solution to my problem. I have a page which displays database entries: database.php. These entries can be filtered with a form. When I filter them and only display the ones I am interested in I can click an entry (as a link) which takes me to that entries page (via php GET). When I am on that entries page (i.e., "view.php?id=1") and hit the back button (back to database.php), the filter form requires to confirm the form

Android back button and MediaController

萝らか妹 提交于 2019-11-26 16:23:22
问题 I know how to take control of the back button. I have a VideoView embedded in a FrameLayout . My question is when the video pops up, the video controls are present for a few seconds. Hitting the back button while they are visible hides the video controls. Is there a way to ignore that function and do the next back action as if the video controls weren't visible? The reason I ask is if I really do want to go back, I must hit the back button twice; once to hide the controls and second to

EditText with soft keyboard and “Back” button

喜欢而已 提交于 2019-11-26 14:22:53
问题 When I'm using "EditText" I have the virtual keyboard. Pressing first time "Back" button hides the keyboard. Second press invokes "onBackPressed" callback in my activity. OK, but... I have no idea how to hook the very first press. I need to process input data as soon as the virtual keyboard dismissed. Any ideas are welcome. Thanks. 回答1: You can override when the keyboard disappears using this method: public boolean onKeyPreIme(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE

How to keep changed form content when leaving and going back to HTTPS page? (works with HTTP)

南楼画角 提交于 2019-11-26 12:54:24
问题 Enter/change something in a textarea Before submitting the form, leave the page (e.g. by clicking browser\'s back button) Go back to the edit page (e.g. by clicking the forward button) Expected result: the content entered in the textarea should still be there Actual result: with HTTPS : all changes are gone (bad!) with HTTP : the changes are still there (good!) Why is this happening when using HTTPS? How can I prevent this? Is the browser or the website responsible? 回答1: You can consider the

How to handle Back button with in the dialog?

﹥>﹥吖頭↗ 提交于 2019-11-26 10:33:36
问题 I am developing an application that when the button is pressed, it opens a dialog with OK and Cancel buttons. It works fine. When the user presses the back button, I am handling this as follows public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK)) { } return super.onKeyDown(keyCode, event); } But the above method is not called. How can I handle this? 回答1: dialog.setOnKeyListener(new Dialog.OnKeyListener() { @Override public boolean onKey

Back button re-submit form data ($_POST)

巧了我就是萌 提交于 2019-11-26 07:41:46
问题 My problem is that the back button causes the browser to say something like \"Page expired\" when the previous page was created by a form. Example: page1: form submitted with search criterias ($_POST request, form points to page2) page2: Receives $_POST request and show result (list of user with links, points to page3) page3: Show user profile Now when the visitor clicks the back button in the browser it will show something like \"Page expired\". Instead the previous page should be shown with