March 17, 2010 at March 17, 2010 · Filed under enart.nnxj.comedit
In my Coldfusion application, I am automatically creating a directory
for each new user account under a unfied folder. So each new user's
folder is based on the username they choose. For example, if i sign up
w/username "jdoe", my application automatically creates the directory
/www/users/jdoe/.
What I need to do is determine the name of
the directory dynamically and then create a cookie based on the name
of the current directory. For example, when a web browser navigates to
www.mysite.com/users/jdoe/, I want the index.cfm page of that "jdoe"
directory to inherit what the current directory/url is, then populate
the variables of the page with that directory/username.Hi,
I'm presuming you already have the directory creation part done; if
not should handle this for you.
You can determine the current directory by using the CGI.PATH_INFO or
CGI.PATH_TRANSLATED variables. It's not clear to me why you want to
set a cookie explicitly (rather than using the automatic session
tracking) but there is no reason why you can't then stuff this info
into a cookie using in the normal way.
Check out the docs on Macromedia if you need more syntax info, etc.:
http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/Expressions5.htm
The CF forums on Macromedia.com are also very useful for this sort of stuff.
Otherwise clarify if I haven't understood what you are trying to do.#If you have any other info about this subject , Please add it free.# |
|