Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 07-27-2007, 04:51 AM redirect in jQuery
Junior Talker

Posts: 1
Trades: 0
Hello


I need a script that will logout a user from his account after 10 minutes [let's say]. So it needs to redirect the user after those 10 minute to a logout.php page...


I made a small script in jQuery that sends [through] POST the current time and based on a time stored in a SESSION variable it shows to the user how much time he has, and after the time is "ended" the SESSION logout variable is set to 1, but I cannot refresh the page so that the settings take place


can anyone help me?

I tried with:

<php> --> header("Location: index.php");

it's not working because the headers were already sent

<JS> --> window.location = "index.php";

it's not working... [or I'm not using it where I should use it...]
chris-T33 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-27-2007, 06:15 AM Re: redirect in jQuery
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
In php, you need to place a header() call before anything is sent to the browser (ie: echo, print or whatever else).
Or you need to use the output buffering function http://www.php.net/manual/en/ref.outcontrol.php


As for javascript, depending of the layout of the page, you may need to do a
Code:
top.location="index.php"
This should be working anywhere you place it in the page.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to redirect in jQuery
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23071 seconds with 12 queries