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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection problem, Need Help!!!!

Status
Not open for further replies.

SteelDragon

Programmer
Feb 1, 2001
134
US
Ok, I've been around the bend with this about 8 million times, someone PLEASE HELP!!!! I have a page that in included in my application.cfm file, via CFInclude, that is to redirect a user based on a database variable. I cannot get it to work at all!! Here is my redirection page code, please someone Help me.... I needed this last week :(

Thanks in advance,
SteelDragon
-----------begin code-------------

<CFAPPLICATION NAME=&quot;MyApplication&quot; SESSIONMANAGEMENT=&quot;Yes&quot; SESSIONTIMEOUT=&quot;#CreateTimeSpan(0,0,0,30)#&quot; APPLICATIONTIMEOUT=&quot;#CreateTimeSpan(0,0,0,30 )#&quot;>
<CFPARAM NAME=&quot;session.LoggedIn&quot; DEFAULT=&quot;FALSE&quot;>

<!-- If the user is not logged in yet -->
<CFIF #SESSION.LOGGEDIN# IS &quot;FALSE&quot;>

<!-- ... and not currently on the login pages, or the forgotten password page -->
<CFIF (CGI.SCRIPT_NAME IS NOT &quot;/login.cfm&quot;) AND (CGI.SCRIPT_NAME IS NOT &quot;/PowerOLAP/results.cfm&quot;)>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
alert(&quot;The system has detected you have not logged in or your session on this machine has timed out. You will now be prompted for your login/password.&quot;);
self.location='login.cfm';
</SCRIPT>
</CFIF>

<CFELSE>

<!-- this will reset the time stamp every time the user accesses a non-login related page, to keep track of his activity. -->
<CFIF (CGI.SCRIPT_NAME IS NOT &quot;/login.cfm&quot;) AND (CGI.SCRIPT_NAME IS NOT &quot;/PowerOLAP/results.cfm&quot;)>
<CFSET APPLICATION.USERSLOGGEDIN[&quot;#Session.UserID#&quot;].TIMECREATED = NOW()>
</CFIF>

</CFIF>


<cftry>
<cfif CheckUser.WebCustomer is -1>
<cflocation url=&quot;../Scripts/cgi-bin/cgirdir.exe?PartnerFTP&quot; addtoken=&quot;No&quot;>
<cfelseif CheckUser.WebPartner is -1>
<cflocation url=&quot;../Scripts/cgi-bin/cgirdir.exe?CustomerFTP&quot; addtoken=&quot;No&quot;>

<cfelse>
<CFLOCATION url=&quot; addtoken=&quot;No&quot;>
</cfif>
<cfcatch>
</cfcatch>
</cftry>

------------end code-----------
 
Hey Steel,

I thought I posted a response to this issue a few days ago. Did you not see it or did it not help?

GJ
 
GJ, I tried all of that, and sever variations on those themes, I'm at a loss, nothing seems to be working. You have helped me SOOOOO much in the past I really appreciate it, but this problem seems to be my very own personal nemesis. Any other ideas would help.... I've gone into a mental block on this and can't think anymore... :(


Thanks,
SteelDragon
 
Ok GJ,
Time to give me my last piece of the puzzle!!! I finally got it!!! ;) Now My last piece is this: I have a login on a form and I want to make the login name a variable that I can pass to another page once the user has logged in successfully. What do I need to do to set that login name as a variable, and then pass it to this FTP page?

Thanks Beyond Thanks,

SteelDragon
 
there is a nice example, very clear, in the doc, about the application.cfm page ...
 
Hey Steel,

Are you wanting to set a session variable to hold this? That's what I usually do. When your login page validates them, just set session.username to their login name and this will be available on all of your pages.

<cfset session.username = form.username>...

Let me know if I'm missing something.
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top