?target=xx.asp not working how it should (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Giomanach -> ?target=xx.asp not working how it should (6/25/2004 16:11:51)

Hi Guys

A client of mine wants their site to be fully integrated etc. They also want a Snitz forum, and the whole site to be accessed by members only. So I thought use the Forum login system.

I use the following to redirect users to the login page it they aren't logged in via Session Cookies:

<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("UserGood") = False or IsNull(Session("UserGood")) = True then

Response.Redirect"forum/login.asp?target=../default.asp"
End If
%>

The Snitz forum works on a login.asp?target=xx.asp system. xx.asp can be any page you like. Should I be use absolute site path, or should reltive work, as when the user logs in successfully they get redirected to the forum index? If it can't be solved, I shall ask client if that's OK

TIA

Dan

<edit>
You also get redirected if you have logged in. Any reason why?
</edit>




Spooky -> RE: ?target=xx.asp not working how it should (6/25/2004 21:14:49)

Is "forum" a subweb?




Giomanach -> RE: ?target=xx.asp not working how it should (6/25/2004 23:23:18)

sub folder




Spooky -> RE: ?target=xx.asp not working how it should (6/26/2004 0:09:48)

Im not entirely clear on the question - but rather than use "../", just use the path relative to the root

Response.Redirect"forum/login.asp?target=/default.asp"




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 1:07:51)

That's wjhat I'm trying to do. The home page is up one directory level. I have it:

default.asp & Includes for it
faq.asp....and so on
 Documents
 Forum
 Listserver
 Classifieds


Everytime the user logs in, you get the Login Successful message, the link saying "Return to page" is right, but when you click on it, or allow for the auto redirect, it takes you to the forum home page, not the one stated in the target. I might just have to alter names

Dan




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 1:19:41)

Live Example:

http://temp.gapersonalinjury.ntwebb.com

Login:

Username: Giomanach
Password: tech45less




Spooky -> RE: ?target=xx.asp not working how it should (6/26/2004 3:15:26)

If you use a fully qualified URL in the meta - itll be clearer where the redirect is going.

Where should it go after logging in?




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 3:22:59)

It should go to a page like so:

http://temp.gapersonalinjury.ntwebb.com/default2.asp

I haven't tried an absolute URL yet. That's the next thing to do.

Clients wants it all integrated, so I thought, yeah lets use the Forum log in syste so I don't have to make the users have two sets of login details....Why does it never play nice when you want it to?

Dan




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 3:29:06)

OK, full url as the target doesn't work either.

Here's a strange on for you. On localhost it redirects to http://localhost/default.asp but on the host is redirects to the forum default.asp.

The login system for Snitz forum works on a target basis. You SHOULD be able to type in login.asp?target=page.asp where page.asp is the targetted page. I have also set the forum cookies to the whole web instead of just the forum.

I'm thinking I may need to rename the default homepage and put it all on the same directory level

Dan




caz -> RE: ?target=xx.asp not working how it should (6/26/2004 5:46:50)

Is this something new? I was under the impression that you couldn't get Snitz to work with the Login ie. just using one user login to access the forum as well as the rest of your protected pages.

Have I missed something, somewhere? ( Wouldn't be the first time though [:)])




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 6:27:54)

Carol

There isn't anything within the Snitz documentation to say you can't extend the usage of the features of the forums. Yes I read them[:D]

The other option is to use something like Spooky Login to potrect the main pages, and have the forum as separate login, but my client has had complaints from his users about the need for two set of login details. I can't interlink any of my login scripts, or Spookys Due to DB config and the difference between usage of the DB.

I think it's a directory level thingy that's my problem[&:]




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 9:17:11)

Hi Dan, where have you got the file login.asp? Is that in the forum directory? If so I don't quite understand why you can't use what Spooky said 'Response.Redirect"forum/login.asp?target=/default.asp"' because the target URL is relative to where login.asp is.

I don't understand what you mean when you say that it redirects you to the forum home page, surely that's where they want to be upon logging in?

The forums are using two field aren't they? forum.asp and default.asp, so if you want them to go to a specific forum just use 'forum.asp?FORUM_ID=xx' in the target.

Mark




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 9:25:30)

Mark

You have missed the point of my question totally. My aim is to utilise the forum login system, so it is SITE WIDE, not just relative to the forum. I think my problem is, I have all main files for the subfolders named default.asp, and the forum is getting confused with it all.

What I want to happen is when the user goes to any page at http://temp.gapersonalinjury.ntwebb.com, if they aren't logged in via Session cookies etc, to be redirected to the forum login system, and then when successfully logged in, they get redirected to the page they attempted to access straight off.

Does that make any sense?

Dan




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 10:09:40)


quote:

ORIGINAL: Giomanach

Mark

You have missed the point of my question totally.

If I missed the point then I think possibly everyone else who has posted missed it too, I think!

quote:

ORIGINAL: Giomanach

My aim is to utilize the forum login system, so it is SITE WIDE, not just relative to the forum. I think my problem is, I have all main files for the subfolders named default.asp, and the forum is getting confused with it all.

Now that makes more sense. Your original question was merely on whether to use an absolute or relative URL.

Can I just ask, why give non-members access to even see the different places where they can go, Forums, Documents etc. when you could create an initial 'gateway' page where if you are not a member then you can't view the site at all. Missing the point again?

Oh yeah, I'm not that familiar with PHP, but surely there must be a referrer global variable that can be stripped down, and then added to the redirect part of your script? I know that PERL had this capability so I'm sure PHP does. That way the user would revert back to the page they wanted to view, now authorized.

Mark




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 10:15:02)

Considering I'm using ASP here, PHP is out of the question.

It's not me who wants to restrict all access, it's the client, and the client is always right, whether I like it or not.

Me thinks it's time to rearrange the structure and rename a few files....

Dan




BeTheBall -> RE: ?target=xx.asp not working how it should (6/26/2004 10:22:24)

What does the user authentication code on default.asp look like? Whatever you have done right now, one cannot access http://temp.gapersonalinjury.ntwebb.com whether logged in or not.




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 10:37:24)

Quite simply:

<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("UserGood") = False or IsNull(Session("UserGood")) = True then

Response.Redirect"forum/login.asp?target=/default.asp"
End If
%>

I am about to re-organise and test a different directory structure

Dan




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 10:38:38)

Ok, well i'm sure ASP has that functionality. You can get to the URL, but Dan put a ',' in the URL so that's why it doesn't work, your link works Duane. Ok, back to the question...

User tries to access 'http://temp.gapersonalinjury.ntwebb.com/documents/default.asp' is the code contained in this file:

<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("UserGood") = False or IsNull(Session("UserGood")) = True then
Response.Redirect"forum/login.asp?target=../default.asp"
End If
%>

I'll wait to see before I post any more.




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 10:44:51)

quote:

'http://temp.gapersonalinjury.ntwebb.com/documents/default.asp'

In the end it will be any page on the site

Dan




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 10:53:16)

Ok, well if you have that code on each of the pages, it should look like:

<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("UserGood") = False or IsNull(Session("UserGood")) = True then
Response.Redirect"forum/login.asp?target=./documents/default.asp"
End If
%>

Should only have one . as it'll only be going back one level and then opening the documents directory. Is that code relative to the 'forum' section? i.e. accessing 'documents' would give: Response.Redirect"documents/login.asp?target=./default.asp" or is login.asp the exact same file in a fixed location?

Surely then you would just modify each occurrence of your code and replace 'documents' with where you actually want to go i.e. list server etc.




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 10:58:09)

Mark,

No matter whether you use / ./ or ../ it will onlt take you up one level. I have the home page ASP docs in the home directory, and everything else (Documents, Classifieds, Forum) is in sub folders. Re-organisation needed

Dan




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 11:08:05)

Is the <meta http-equiv="Refresh" content="2; URL=default.asp"> in login.asp using 'target' as a variable and you stick it in here?

[edit]Yes it is, just checked[/edit]




markhawker -> RE: ?target=xx.asp not working how it should (6/26/2004 11:15:39)

This link does work, and forwards you to the documents index page.




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 11:37:19)

Guiys, the above links, may not work anymore, I am altering file structures

Dan




Giomanach -> RE: ?target=xx.asp not working how it should (6/26/2004 12:00:57)

Can't go any further until host has alter directory access permissions, shall let you know how it goes

Dan




Giomanach -> RE: ?target=xx.asp not working how it should (6/27/2004 8:51:10)

OK

Forum and index pages are on the same level. Home page is now index.asp and forum home page is default.asp. It works on my local machine on either method (sub folders/same level), but not on the hosts servers. It's gotta be the coding I'm using to check the cookies, b'cos it still doesn't work.

Any ideas on what else I can use to check cookies? (ASP VBScript only please)

Dan




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375