Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: Automatically doing something if logged in Date: Tue, 23 Feb 2016 08:10:03 +0100 Lines: 22 Message-ID: <56CC05CB.2060001@arnowelzel.de> References: <1b712b26-1665-45f9-9017-1dcf9e8bfbcb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net N1Q1T/w7wShtINt5Y7W56ANlQU20XaLVK6hqn4TtT1KgF4n2yl Cancel-Lock: sha1:OX2Ln+1qCvD8/bcxDutcA/Uz0Fs= In-Reply-To: Xref: csiph.com comp.lang.php:16598 J.O. Aho schrieb am 2016-02-22 um 20:21: > On 02/22/2016 07:02 PM, bit-naughty@hotmail.com wrote: >> Hi, >> So say there's a forum site, and if there' been a reply to a post I've made, it sends me a link to that thread. If I click on it, and I've remained logged in when I was there last, then it *automatically takes me to that thread*. If I wasn't, then it shows me a Login box - when I log in it *automatically takes me to that thread*, but if I just went to the homepage NOT clicking on any email link, and I THEN log in, then it shows me something else (like "My homepage" or something), NOT that thread. >> It's quite late, am I making sense? :) >> How is this pulled off? > > If you want things to happen "automagically", then you need to think > more than just PHP, add some javascript (there are loads of good > frameworks) and use websockets. This is not required at all. Just add the desired target after the login as a parameter to the login page or set a cookie which will be used by the login page to redirect to the target after successful login etc.. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de