473,503 Members | 939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirection to last url??

I want my site to send users back to where they were prior to being told
they have to login. For instance, say user accesses page1.php. They try to
do something and they get a message telling them to login. So they login,
which is done at login.php. After they log in, I want them to end up back at
page1.php.

Any idea how to do this?

thanks,

brian
Jul 17 '05 #1
1 2167
Brian Huether <bh********@comcastspam.net> wrote:
I want my site to send users back to where they were prior to being told
they have to login. For instance, say user accesses page1.php. They try to
do something and they get a message telling them to login. So they login,
which is done at login.php. After they log in, I want them to end up back at
page1.php.

Any idea how to do this?


IMHO most often used:

request: http://example.com/foo
respons:
if logged in: the content of http://example.com/foo
if not : redirect to
http://example.com/login.php?oldurl=...mple.com%2Ffoo

request: http://exmaple.com/login.php
respons: authenticate user
if autheticates and oldurl exists: redirect to $_GET['oldurl']
if autheticates and oldurl misses: redirect to loggedin.html
else get authentication

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4009
by: Wazz Up | last post by:
Hi, I'm trying run an image slide show where the images rotate once each, then after the last image in the array has been displayed for the specified amount of time, a redirection to another...
52
5386
by: Gerard M Foley | last post by:
Can one write a webpage which is not displayed but which simply redirects the user to another page without any action by the user? Sorry if this is simple, but I am sometimes simple myself. ...
15
5120
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
7
2101
by: Steph | last post by:
Bonjour, Je souhaite lancer une redirection vers un fichier php via SRC= dans une condition if (voir ci-dessous en bas du script) mais la redirection ne fonctionne pas. Par contre la condition...
4
3112
by: Tim Marsden | last post by:
Hi, If I navigate from Page1 to Page2 then to Page3, using the response.redirect. When the user press the Back button, I what then to go to Page 1 and start again, not Page2. I dont want the...
8
2064
by: Sullivan WxPyQtKinter | last post by:
I am now programming python scripts for CGI environment. The redirection has been discussed in this forum for over one hundred times. I have seen most of them, but still have some questions: 1....
1
1009
by: graphicsxp | last post by:
Hi, I'm using FormsAuthentication.redirectFromLoginPage() in order to to user authentication. The problem is that I'm redirected to the last page visited before the session expired (or the...
7
3561
by: iaesun | last post by:
hello, this post assumes executing a program with file redirection as follows: program.exe < intput.txt where input.txt is a text file where there is not necessarily any whitespace after...
13
2678
by: souissipro | last post by:
Hi, I have written a C program that does some of the functionalities mentionned in my previous topic posted some days ago. This shell should: 1- execute input commands from standard input,...
1
3508
by: comp.lang.php | last post by:
require_once("/users/ppowell/web/php_global_vars.php"); if ($_GET) { // INITIALIZE VARS $fileID = @fopen("$userPath/xml/redirect.xml", 'r'); $stuff = @fread($fileID,...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.