Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login to certain page if coming from a specific page

Status
Not open for further replies.

toyt78

Technical User
Apr 5, 2005
125
0
0
US
I have login page for two pages. I am trying to get it to go to one page if it is at a certain page (view.cfm) and for all other pages it comes from it should go to the main page (index.cfm).

I tried conditions based on referer page but it wont work and always seems to go to the index.cfm page.
Please advise.

Code:
<CFSET Session.Auth ='True'>                              
<CFSET Session.Admin = Form.Username>                            
<cfset session.AA = ListFirst(ListLast(cgi.http_referer,"/\"),"")> 
<cfset session.BB = ListFirst(ListLast(cgi.http_referer,"?"))>	
<cfif session.AA eq "view.cfm">
	<CFLOCATION url='editPage.cfm?BB'>	
<cfelse>
	<CFLOCATION url='index.cfm'>	
</cfif>
Tried it without the session.AA and session.BB (using just variables "AA" and "BB") and it still wont work.
I also tried cgi.path_info for trying to get last page but it wont work on my browsers.
 
Do a dump of session.AA and confirm that it is indeed "view.cfm"



“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
 
Well I should add the usual caveat about using the referrer and how unreliable it can be - it can be blocked by your browser, plugins, proxies etc. Can you not simply have maybe a form field on each page indicating what page it is then after your authentication you can check this field to determine where to go to after. Unless I've missed something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top