Login return to the page you were on.. [message #646] |
Thu, 21 February 2002 00:09 |
seang
Messages: 5 Registered: February 2002 Location: Australia
Karma: 0
|
Junior Member |
|
|
Hi there,
I think this would be a nice feature....
(Sorry about my messy code...but I am sure you will get the Idea)
On the page you detect the incorrect login: $url = sprintf("%s%s%s","http://",$HTTP_HOST,$SCRIPT_NAME); if !logged in then forward them to the login and send the url where you were at and and imporant info.
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$root_dir."login.php?url=".$url.$query_string1."\ "><script language=\"JavaScript\">\n<!-- setTimeout(\"window.location = unescape('".$root_dir."login.php?url=".$url.$query_string1.& quot;')\",2000);\n //-->\n</script>\n</head>";
Header alway screw up for me incertain instances....and the meta redirect has trouble with one of the Opera browsers.
When you are at the login, set the default page if empty..
if (!($url_send) or ($url_send == "http://www.webdesigners.net.au/login.php")) {$url_send = $root_dir."community.php";}
In the login form have the old url and any important info: <input name="url_send" type="hidden" value="<? echo $url ?>"> <? echo $query_form ?>
Then when every thing is ok again send them back echo "<meta http-equiv=\"Refresh\" content=\"0;url=".$url_send."?".$query_string1."\& quot;><script language=\"JavaScript\">\n<!--\n setTimeout(\"window.location = unescape('".$url_send."?".$query_string1."')\",200 0);\n //-->\n</script>\n</head>";
Hope this is useful
Regards
Sean
|
|
|
Re: Login return to the page you were on.. [message #655 is a reply to message #646] |
Thu, 21 February 2002 15:13 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Good idea, we already have a built in refering url tracking, I'll see what needs to be done to allow the forum to redirect the person from the login form to the page they came from.
I suspect it will be working in latest CVS sometime tonight.
FUDforum Core Developer
|
|
|
|