Page 1 of 1
page isnot redirecting
Posted: Fri Oct 26, 2007 5:15 am
by qumar
Everah | Please use the appropriate bbCode tags when posting code in the forums.
hi,
if member isnot login, asking to login the page. but after login, the page isnot redirecting to previous page.
i am using the
but i amnot getting the previous page. give some idea.
local working, but online not working. please help to me.
thanks,
qumar.
Everah | Please use the appropriate bbCode tags when posting code in the forums.
Re: page isnot redirecting
Posted: Fri Oct 26, 2007 7:54 am
by Zoxive
qumar wrote:hi,
if member isnot login, asking to login the page. but after login, the page isnot redirecting to previous page.
i am using the
<?php
$_SERVER['HTTP_REFERER']
?>
but i amnot getting the previous page. give some idea.
local working, but online not working. please help to me.
thanks,
qumar.
Some browsers don't give the Server the Referring Page, and you can even turn it off in Firefox.
Your Best Bet is to use $_GET Variables, or $_SESSION to store the last url they were at.
Posted: Fri Oct 26, 2007 8:09 am
by shiznatix
Whenever I want that to happen I always save the page + all get variables that are currently on every time they load a page into a session variable. That way, if they do something like login and you want to put them back to where they where at first, then you can just check the session and bam, your good to go.
Posted: Fri Oct 26, 2007 9:39 am
by s.dot
Something like...
Code: Select all
$location = $_SERVER['PHP_SELF'];
$location .= !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '';
$location = urlencode($location);
header('Location: http://www.example.com/login.php?next=' . $location);
exit;
for search date not redirecting
Posted: Sat Oct 27, 2007 3:58 am
by qumar
Everah | Please use the appropriate bbCode tags when posting code in the forums.
hi,
i am using the following code to redirect to the previous page.
Code: Select all
<?php
$link=$_SERVER['PHP_SELF'];
?>
i am using sessions. but it is working only for general form.date search and keyword forms not working.
for date search i am using following code.
Code: Select all
<?php
$_SERVER['PHP_SELF']."?search_date=$search_date";
?>
but search_date value not coming back. please give some idea.
thanks,
qumar.
Everah | Please use the appropriate bbCode tags when posting code in the forums.