Print Page | Close Window

Redirecting to other pages in my site

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27911
Printed Date: 28 March 2026 at 2:20pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Redirecting to other pages in my site
Posted By: Darsey
Subject: Redirecting to other pages in my site
Date 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!
 



Replies:
Posted By: Shaun
Date 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


Posted By: Darsey
Date 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?


Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Scotty32
Date 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 - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: Darsey
Date 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


Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net