Re: Some beginner questions
> 3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire query string, but I > want to access specific fields IF url = http://www.cfmaniacs.com?name=bob&car=ferrarri&license=IBR8K4CF THEN DO Hi #name#. You drive a #car# with the license plate #license#. If you want name/value pairs do what DWatts said 8-) -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Some beginner questions
On 5/31/00, Cristi penned: >If anyone can find some time... Can't answer the javascript question. > >2) How do I manage strings containing special characters as dbl. quote (i.e. >") > Should I prefix them with something. > > I'd like to have an output like > > say "hello" You can pass the ascii code. say #CHR(34)#hello#CHR(34)# >3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire query >string, but I >want to access specific fields One way is to loop through: #queryvalue# That would return: variable1=value1 variable2=value2 variable3=value3 variable4=value4 variable5=value5 variable6=value6 There are any number of things you could do with each item by doing a find() function and setting what's left or right of the = sign. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Some beginner questions
One thing to add/correct from Philip's response: #cgi.query_string# contains url parameters. You can reference those as url.variablename (or just variablename) to get the values most of the time. One exception to look out for on that is if you have a url like this: index.cfm?a=5&a=6&a=7 When the same variable is named several times, the variable only gets the last value in the url, not all three. In that case, you have to use the List*() functions to get the variables... HTH Larry >>> [EMAIL PROTECTED] 05/31/00 11:07AM >>> > 1) Can I call a JavaScript function from CF? > Smth. like > > where f is a JavaScript function. > > I tried , but it didn't work. Firstly, CF is SERVER-side, JavaScript is CLIENT-site, they are mutually exclusive Secondly, Why not write the code in CFScript and just run it on the variable? y=y+10; y=y*x; y=y-z; Or whatever... but you can't create and call functions in CFScript. > 2) How do I manage strings containing special characters as dbl. > quote (i.e. ") > Should I prefix them with something. > > I'd like to have an output like > > say "hello" Double the quotes... or will display the quotes properly (older browsers dislike " as an output) > 3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire > query string, but I > want to access specific fields #myQuery.ColumnList# is a comma separated list of the fields called in a query, note that select * from myTable fields will be in the order that CF decides. Philip Arnold -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Some beginner questions
re CGI.query_string: if you know the field name, the value is in the variable named cgi.your_field_name -Original Message- From: Jennifer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 30, 2000 1:06 PM To: [EMAIL PROTECTED] Subject: Re: Some beginner questions At 05:50 PM 5/31/00 +0300, you wrote: >Hello there. >If anyone can find some time... > >1) Can I call a JavaScript function from CF? > Smth. like > > where f is a JavaScript function. > > I tried , but it didn't work. Try putting f(y) in quotes Should I prefix them with something. > > I'd like to have an output like > > say "hello" It depends on what you want to do with them. Sometimes you might have to escape them by changing " to "" but sometimes " will work. If you are sending info to a database you will probably put text fields in single quotes ' ' which means that you may have to escape the single quotes instead of the double quotes. Try doing what you want to do and send us an error message if it doesn't work. >3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire query > string, but I >want to access specific fields I think that what you want is one of these two: #YourFieldName# #YourOtherFieldName# or #YourQueryName.YourFieldName# #YourQueryName.YourOtherFieldname# The second one will only return the results for that field in the first record, but the first one will return the results for that field for every record. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Some beginner questions
1. Don't Know. 2. As far as I know you should be able to use almost anything in the data except #'s. 3. Just use the name of the field you want. IE: If #query_string# is ?cfid=1234&cftoken=76323661 Then to access just the pieces you would cfid = #cfid# cftoken = #cftoken# and you would get cfid = 1234 cftoken = 76323661 HTH, --K Katrina Chapman Consultant Ameriquest Mortgage "Cristi" e.west.ro>cc: Subject: Some beginner questions 05/31/00 07:50 AM Please respond to cf-talk Hello there. If anyone can find some time... 1) Can I call a JavaScript function from CF? Smth. like where f is a JavaScript function. I tried , but it didn't work. 2) How do I manage strings containing special characters as dbl. quote (i.e. ") Should I prefix them with something. I'd like to have an output like say "hello" 3) How can I get the value of each field in a query string? I know the #cgi.query_string# which returns the entire query string, but I want to access specific fields Thanks in advance Cristi -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Some beginner questions
> 1) Can I call a JavaScript function from CF? > Smth. like > where f is a JavaScript function. > I tried , but it didn't work. No, you can't directly call a JavaScript function from CF; CF generates documents on the server, which are then sent back to the client, where any JavaScript will execute. You can use CF to write JavaScript, and you can use JavaScript to execute HTTP requests, and that's essentially the limit of any cross-communication between them. > 2) How do I manage strings containing special characters as > dbl. quote (i.e. ") > Should I prefix them with something. > I'd like to have an output like > say "hello" In CF, you can escape a double quote by doubling it: "This is my string, and ""this"" is double-quoted." > 3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire > query string, but I want to access specific fields If you're using CF 4.5, you can reference the URL structure, which contains each name-value pair within the query string. You might need to read up on Structures a little bit. Here's an example, which will loop over the URL structure and output the name and value for each URL parameter: #ThisURLParam#: #URL[ThisURLParam]# If you're using an older version, you can loop over the query string as if it were a list; the delimiter for the list is the ampersand (&). Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Some beginner questions
> 3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire > query string, but I > want to access specific fields #url.login# will give you the value of "login" in the url for example, in... http://www.whatever.com/index.cfm?node=developer&login=pablo #url.node# is developer and #url.login# is pablo Is that what you were looking for? Pablo Nevares Information Technology Hendricks & Partners [EMAIL PROTECTED] -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Some beginner questions
At 05:50 PM 5/31/00 +0300, you wrote: >Hello there. >If anyone can find some time... > >1) Can I call a JavaScript function from CF? > Smth. like > > where f is a JavaScript function. > > I tried , but it didn't work. Try putting f(y) in quotes Should I prefix them with something. > > I'd like to have an output like > > say "hello" It depends on what you want to do with them. Sometimes you might have to escape them by changing " to "" but sometimes " will work. If you are sending info to a database you will probably put text fields in single quotes ' ' which means that you may have to escape the single quotes instead of the double quotes. Try doing what you want to do and send us an error message if it doesn't work. >3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire query > string, but I >want to access specific fields I think that what you want is one of these two: #YourFieldName# #YourOtherFieldName# or #YourQueryName.YourFieldName# #YourQueryName.YourOtherFieldname# The second one will only return the results for that field in the first record, but the first one will return the results for that field for every record. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Some beginner questions
> 1) Can I call a JavaScript function from CF? > Smth. like > > where f is a JavaScript function. > > I tried , but it didn't work. Firstly, CF is SERVER-side, JavaScript is CLIENT-site, they are mutually exclusive Secondly, Why not write the code in CFScript and just run it on the variable? y=y+10; y=y*x; y=y-z; Or whatever... but you can't create and call functions in CFScript. > 2) How do I manage strings containing special characters as dbl. > quote (i.e. ") > Should I prefix them with something. > > I'd like to have an output like > > say "hello" Double the quotes... or will display the quotes properly (older browsers dislike " as an output) > 3) How can I get the value of each field in a query string? > I know the #cgi.query_string# which returns the entire > query string, but I > want to access specific fields #myQuery.ColumnList# is a comma separated list of the fields called in a query, note that select * from myTable fields will be in the order that CF decides. Philip Arnold ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.