944,082 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 7018
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Oct 1st, 2007
0

How to disable brouser back.

Expand Post »
I want help.
what i do:I creat three pages 1. login.php, 2. welcome.php, 3.change password.php.
when we login(right Id & P/W) welcome.php will open,On that page i have put two option
i. Logout, ii.change password.,on clicking on Logout we will logout to enter again we have to enter password.As session is distroyed.

Problem: On welcome.php page when I logout then sesstion is dertroyed so we can not go back. welcome page when I click on back button(on brosure) it come on login page and on click on forward botton it come on welcome page.But i want ones it come on login page without without entering Id & password it should not come on welcome page as in logout condition.
Similar Threads
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 1st, 2007
0

Re: How to disable brouser back.

you could use javascript to disable back i think but its not secure as they can just disable java.
Moderator
Featured Poster
Reputation Points: 1800
Solved Threads: 575
Moderator
jbennet is offline Offline
16,528 posts
since Apr 2005
Oct 1st, 2007
0

Re: How to disable brouser back.

I don't know too much about javascript,so plz tell me some script if u know for this.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 1st, 2007
0

Re: How to disable brouser back.

I find one script that is
<Script>window.history.forward(1);</Script>
but it disable back button for all pages.

anyone have batter idia.if any then plz tell me.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 2nd, 2007
0

Re: How to disable brouser back.

i am trying to understand exactly what you mean. so you don't want people to go back to welcome.php after logout. is that what you are saying?
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 2nd, 2007
0

Re: How to disable brouser back.

Hi Ajay Babu

According to me, you should just use session with proper understanding, I think your code write properly. Just make sure the use of session...



Thanks
Nishit Soni
nishit_0627@yahoo.co.in
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nishit_soni is offline Offline
3 posts
since Sep 2007
Oct 3rd, 2007
0

Re: How to disable brouser back.

yes kkeith29,what you understand that is right.and I have got the solution for that there is javascript which slove my problem that scripte is.
PHP Syntax (Toggle Plain Text)
  1. <code class="inlinecode">
  2. <Script>
  3. window.history.forward(1);
  4. </Script>
  5. </code>

but still i m looking for batter solution
now I want something like yahoomail,on which after login ones if we come on login page(without doing logout) then we have to login again.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 3rd, 2007
0

Re: How to disable brouser back.

Soniji thanks for suggestion.
I read basic of session and I m using that,as I do logout session get distroyed.but I don't know how to distroy session when user come on privious page(i.t. loginpage) so if u have some idea about that then plz help me.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 3rd, 2007
0

Re: How to disable brouser back.

try this.

Login page -

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
  3. session_destroy();
  4. }
  5. else {
  6. //Put login script here
  7. }
  8. ?>
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 4th, 2007
0

Re: How to disable brouser back.

thanks kkeith
I try this code but still problem is not slove,Do u have any other idea then plz suggest me.plz Tell that how can we handal event by windows object in php.
Click to Expand / Collapse  Quote originally posted by kkeith29 ...
try this.

Login page -

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
  3. session_destroy();
  4. }
  5. else {
  6. //Put login script here
  7. }
  8. ?>
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how can i redirect like asp
Next Thread in PHP Forum Timeline: Getting mysql "UNaffected" rows





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC