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

login to directory

Status
Not open for further replies.

77zxmax

MIS
Dec 28, 2004
45
CA
Hi all, i'm try to acheive the following:



User login with username and password (db backend)
>> if successful , he will be directed to his own folder

eg: if john is login in with username = john and password = password, >> he will be automatically directed to webroot\#john#\

where in each directory , there is a file called index.cfm that will display current folder content

i started with a simple login script >> including the application.cfm , but i failed to have make this work dynamic way ..

my final goal is : i want to insert files for members to grap , and each member should have his own private folder , where he will be directed there based on his login name

i hope i'm making sense , :)

any help will be greatly appriciated

 
What exactly is the problem you are having? We are here to help with specific issues you might be having, but we are not here to provide you with full working solutions.

Hope this helps

Wullie

YetiHost - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
thanks :

my very problem is in the cflocation tag:
i can't put dynamic entry ;
eg: <CFLOCATION URL="#username#/>

it seems that i can't put ## in the cflocation tag, only path format, is there a way around this

thanks again

 
According to LiveDocs
cflocation

Stops execution of the current page and opens a ColdFusion page or HTML file.
You are not referencing a ColdFusion page or HTML file, you are referencing a directory, so that's why cflocation doesn't work.

Try something like:
Code:
<CFLOCATION URL="#username#/index.cfm>

OR

<CFLOCATION URL="[URL unfurl="true"]http://www.yourwebsite.com/#username#/index.cfm>[/URL]

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
that's not necessarily true.

paste this and run it
<cflocation addtoken="No" url="
A URL is perfectly valid ending in a directory. that request is sent to the and the decides what the default file is for that site.

I use file-less redirects all the time.

What is happening is A) he's obviously using relative paths by the look of the cflocation tag, so the complete URL he is calling is wrong or B) the folder does not exist. C) something else that I did not think of, however, option C covers that.




Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
We need to see the value of #username#, the current URL in the address bar of the URL running that cflocation.

comment out your cflocation and just cfdump var="#username#/"> and give us both pieces of info i just mentioned.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
the username name is coming from the database
<!--- this where i get username from the login page --->
<CFSET sLocalUserID = "">
<CFSET sLocalUserID = session.userid>

<!--- my database query --->
<CFQUERY name="table_member" datasource="kei">
SELECT *
FROM tblmember
</CFQUERY>

<!-- will be directed to his own folder --->
<CFCASE value="#session.userid#" >
<cflocation url = "/secure/custom/#session.userid#/" addToken = "no">

-------------------------------------

i guess i could add an index.cfm page, that will display file in a directory format, .. but i would like to hide that index.cfm page ..

wouuld that work ?

 
I'm assuming that's just samples of the code you're running.

CFDUMP or CFOUTPUT the value of session.userID

BTW, the way you are using cfcase looks bizarre to me. What else is it doing? Why are you dynamically getting a CFCASE value from a user ID? I have a feeling things are overly complicated and obfuscated.

But first, what is the value of session.userID?


Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
i have this in my application.cfm

<cfquery name="qValidLogin" datasource="kei">
SELECT *
FROM tblMember
WHERE tblMember.MemberName = '#Form.username#' AND Password = '#Form.password#' </cfquery>


<cfset session.userid = #qValidLogin.MemberName#>

------------------------------
i think i'm making it too complicated for myself :)

 
Please /secure/custom/<cfoutput>#session.userid#</cfoutput>/ and let us know what the VALUE of the variable is.

Also let us know what is not working? is there errors? is there a blank page?


Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top