Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Redirecting to other pages in my site
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redirecting to other pages in my site

 Post Reply Post Reply
Author
Darsey View Drop Down
Newbie
Newbie


Joined: 07 October 2009
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Darsey Quote  Post ReplyReply Direct Link To This Post Topic: Redirecting to other pages in my site
    Posted: 07 October 2009 at 11:43am
Hello. I was wondering if I could get some help on a problem I am having.
 
I am trying to create a classifieds section that uses the forums sign-in functionality. I am basically making it a members only area so that login is being checked and if the user is not logged in redirects back to the login / registration pages.
 
My classifieds page has the following code:
 
<!--#include file="../forum/common.asp" -->
<%
If lngLoggedInUserID = 2 then
   Call closeDatabase()
   response.redirect("" & RootLevel & "forum/login_user.asp?returnURL=classifieds.asp")
End If
Call closeDatabase()
%> 
 
One issues is that my classifieds page is not within the forum. I was wondering if I could just create a redirct.asp page (within the forum directory) that will redirct the user to whatever section of my site they came from. I plan to have other areas (members only) later.
 
As of now the code above does redirct to a login page, but after logging in I am still redirected back to the default.asp within the forum and I want to go back to the classifieds section.
 
I have searched the forum and tried other suggestions but so far none have worked so I thought I would start a new thread.
 
Thoughts?
 
Thanks in advance!
 
Back to Top
Shaun View Drop Down
Groupie
Groupie


Joined: 24 February 2006
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shaun Quote  Post ReplyReply Direct Link To This Post Posted: 07 October 2009 at 11:48pm
Scotty has nailed this one down already

See this thread:

http://forums.webwiz.net/connect-log-in-function-to-page-outside-forum_topic27892_post141713.html

Then go get the mod:

http://s2h.co.uk/wwf/tips/intergration/member-only-pages.asp

Then show some love for Scotty.

Take care,
Shaun
Back to Top
Darsey View Drop Down
Newbie
Newbie


Joined: 07 October 2009
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Darsey Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2009 at 11:05am
Thanks Shaun!
 
I have already done the items listed on the mods page. My page does correctly redirect to the login / incorrect permissions page and logs in but it doesn't return to my new page. Instead it returns to the default page of the forum. This is the problem I'm trying to fix. The thread that you directed me to seems to end before they found an answer to that problem.
 
By looking at the code it looks like you might be able to do something like this:
 
response.redirect("" & RootLevel & "forum/login_user.asp?returnURL=classifieds.asp")
 
but this doesn't work.
 
Ideas?
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2009 at 11:46am
What you will need to do is around line 108 of the file login_user_test.asp is add in some extra code like below:-

If strReturnURL = "classifieds.asp" Then strReturnURL = "../classifieds.asp"


You will need to change the part in red above to the path to the classified.asp page on your website.

This has not been tested, but it should work, or at least something like this will work.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2009 at 7:13pm
Thank you Shaun for the appreciation but my Darsey has already got the Member only part working.

Unfortunately Web Wiz Forums will only redirect within the forum directory for security reasons, so I have not added the redirect part to my tutorial, I will add a note regarding it though.
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
Darsey View Drop Down
Newbie
Newbie


Joined: 07 October 2009
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Darsey Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2009 at 7:32pm
That would be great Scotty! Thanks!
 
Would this work? What if I redirected to an asp page within the forum folder (ex Members_Only_Redirect). I can pass that asp page a variable through the querystring telling it which page to redirect it to outside of the forum.... would this work since this new page wouldn't have any of your security includes in it?
 
Just a thought...
 
Darsey
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2009 at 8:57am
Yes that would work by crating a redirect file within the forums files.

The reason for not allowing paths outside the forum root is that a hacker could use that to send the user to a malicious script or page.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.