Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Redirection ...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

uetlhr
Starting Member

32 Posts

Posted - 28 August 2003 :  06:34:25  Show Profile
hi i wanted my user to be redirected to active topics... so i edited following in inc_header.asp

"<meta http-equiv=""Refresh"" content=""2; URL=" & Request.ServerVariables("HTTP_REFERER") & """>" & vbNewLine & _

as

"<meta http-equiv=""Refresh"" content=""2; URL=active.asp"">" & vbNewLine & _


Now i wanted to modify it as if the user logs in from default.asp then he should be redirected to active.asp ... but if he logs on from any other file like post.asp then he should be returned to origional page so that he can continue his post.

Edited by - ruirib on 28 August 2003 07:07:02

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 28 August 2003 :  07:06:36  Show Profile  Send ruirib a Yahoo! Message
Do a little test with an if statement. Test the variable HTTP_REFERER, as done in line# 58, register.asp . If the value includes default.asp, redirect to active.asp, otherwise, redirect to HTTP_REFERER.

You should be aware, however, that most firewalls block this info, so such a simple situation may fail for most users. If you really want to handle this in all situations, you'd better keep the info from the current page in one of your own session variables named, say, CurrentPage, and then when you arrive at a new page you can check the value of the variable to find out where the user came from.

CurrentPage can be determined using code like this:

Session.Contents("CurrentPage") = Request.ServerVariables("SCRIPT_NAME")


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 30 August 2003 10:11:23
Go to Top of Page

uetlhr
Starting Member

32 Posts

Posted - 28 August 2003 :  10:32:46  Show Profile
Very Sorry to say that i am almost unfamilir with asp.
i do know a lil more about java.
what i have done is to check in if that HTTP_REFERER = default.asp then ........

But it had come out with an error giving out comipltaion error etc.

So please be more generous in telling me the exact code that should work in most of the cases

thanks
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 28 August 2003 :  18:43:59  Show Profile  Send ruirib a Yahoo! Message
Hmmm... Been thinking about this. If you redirect to active.asp as soon as the user enters default.asp, the user won't be able to access default.asp, even if he wants to access specifically default.asp, ever, without being redirected. Sorry to ask, what sense does that make?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

uetlhr
Starting Member

32 Posts

Posted - 29 August 2003 :  12:54:29  Show Profile
no no ....
i want that IF users enters username and pass from default.asp then he should be redirected to active.asp

and IF he enters username and pass from other pages like topic.asp then he should be redirected to HTTP_REFFRER.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 29 August 2003 :  22:09:13  Show Profile  Send ruirib a Yahoo! Message
Replace lines# 310-311

                        Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=" & Request.ServerVariables("HTTP_REFERER") & """>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & Request.ServerVariables("HTTP_REFERER") & """>Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine

by

               if InStr(Request.ServerVariables("HTTP_REFERER"), "default.asp") = 0 then
			Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=""active.asp"">" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""active.asp"">Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		else
			Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=" & Request.ServerVariables("HTTP_REFERER") & """>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & Request.ServerVariables("HTTP_REFERER") & """>Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		end if

Haven't tested this but I think it will work... for users that have HTTP_REFERER preserved by their firewalls.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

uetlhr
Starting Member

32 Posts

Posted - 29 August 2003 :  23:30:23  Show Profile
No,

It always takes me to active.asp and never to the HTTP_REFFERER

And please do think that what can be done to avaoid a situation with a fire wall

I think a better option will be to redirect him to HTTP_REFFERER
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 30 August 2003 :  10:10:35  Show Profile  Send ruirib a Yahoo! Message
Sorry, in the part in red, replace the existing '=' sign by a '<>' as shown

               if InStr(Request.ServerVariables("HTTP_REFERER"), "default.asp") <> 0 then
			Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=""active.asp"">" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""active.asp"">Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		else
			Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=" & Request.ServerVariables("HTTP_REFERER") & """>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & Request.ServerVariables("HTTP_REFERER") & """>Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		end if

The way to fix the code for users without HTTP_REFERER is as I explained in my first post, to create a Session variable to which you assign the value of the current page, in inc_header.asp.
Of course, you can only assign it the current value after you test it. Since there are some pages that post to itself, it may be hard to keep this variable always up to date.

I'm sorry, but I simply don't have the time to do that and test it now, nor for the next few days.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 30 August 2003 10:14:06
Go to Top of Page

RebelTech
Average Member

USA
613 Posts

Posted - 08 November 2003 :  12:58:12  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
This is just what I think I was looking for. I wanted to direct users to default.asp if they logged in from my portal and return them to where they came from if they logged in from anywhere in the forum.
Thanks ruirib, you seem to be saving my bacon quite a bit lately. (blatant kiss up to get you to figure out the session variable test)
Go to Top of Page

RebelTech
Average Member

USA
613 Posts

Posted - 08 November 2003 :  13:04:02  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
This didn't work for me. It always returned me to where I logged in from.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07