| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | PHP, sign in then return to previous page Good day. When a user signs in on my website, they are automatically redirected to the "Member's Area" section of the website. How can I make it so that they are redirected to the page they were on before signing in. (eg. thread in a forum)? Thanks
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | THREAD STARTER #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | PHP Code: Thanks
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | #4 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,267
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Hello, I have edited it to redirect back two pages insted of displaying member area. It displays Do you want to go to member area or back to previous page. If they click member area it goes to member area. If they click back it goes back 2 pages. (Or back to previous page) PHP Code: iNod Here is an edited version without the error. PHP Code:
__________________ I feel old. |
| |
| | THREAD STARTER #5 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | Many thanks iNod. I made a few ammendments but when the "previous page" link is clicked, it takes the user back to the sign in page. Example: http://www.darkfx.co.uk/darkfx/signin.php username: username password: password Thanks again
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | THREAD STARTER #8 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | Still doesn't work Thanks anyway.What would i put in "afterlogin.php", scribby?
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | #9 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,267
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Do this Change Click <a href='#' onclick='javascript:history.back(2)'>here</a> to return to previous page. To Click <a href="javascript:history.go(-2)()">here</a> to return to previous page. iNod
__________________ I feel old. |
| |
| | #10 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Iowa City
Posts: 703
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | why not when you click Sign Url button have something like this: href="signin.php?r=http://www.yoursite.com/blah/prevoiuspageblah.php" and you could just store "r" in a session/cookie/or a hidden form field i use a hidden form field and then instead of doing javascript(-2) or something like that, you get an exact url for the visitor to use (in case user doesnt allow javascript? lol)
__________________ formally ninedogger ------ Want to talk to a stranger? -->| Click Here | TalkToAStranger.com | <-- Meet New Friends |
| |
| | #12 (permalink) | ||||
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,267
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=133907 iNod
__________________ I feel old. | ||||
| |
| | THREAD STARTER #13 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | It worked! Thanks very much iNod
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | #15 (permalink) | ||||
| NamePros Regular Join Date: Jun 2004 Location: Iowa City
Posts: 703
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
It wouldn't be using http_referrer it would be actually getting the URL of the current page and just adding it to the signin link but you know a simplier way, nice
__________________ formally ninedogger ------ Want to talk to a stranger? -->| Click Here | TalkToAStranger.com | <-- Meet New Friends | ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 11:35 AM |
| HOWTO: Install the Apache Web Server, Perl, PHP, and MySQL on Windows | deadserious | Webmaster Tutorials | 96 | 05-27-2007 01:24 PM |
| Need help on one page PHP project | Jim_Westergren | Web Development Wanted | 5 | 09-15-2005 08:40 PM |
| Tutorial: Simple site management with the use of PHP and the query string(?page=1) | deadserious | Webmaster Tutorials | 8 | 10-09-2004 01:20 PM |
| Tutorial: Using PHP require() & include() | Dave S | Webmaster Tutorials | 5 | 03-22-2004 12:40 AM |