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-----------
 
what is not working exactly ? do you get an error ? is it because of the <CFLOCATION ...> or the self.location ???
 
IZA, ok... it's like this, I need to redirect the user when they click on a button to go to a predetermined URL, based on if they have either of two fields in the database checked. One location for yes in one field, one location for yes in the other field. Right now, I get no error, no nothing other than a blank page. I'm not concerned about the security, as I can add this later, I just need a working model or how to redirect based on a value... for ex:
User A logs in, in the DB field Customer user has a check, user A clicks on the FTP link button, and because User A is a customer they get redirected to the customer FTP. User B is a Partner.. same applys but they go to the partner FTP...
Does that make any sense??

Thanks,
SteelDragon
 
MY APPOLOGIES.... Somehow my computer submitted this post Twice, please see the other post on this topic... it is identical, but I have it marked for response.

Again, I'm sorry.

SteelDragon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top