|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
Variable problemThanks for the previous help :) Still following from the previous question, what I want to do is be able to call one page which displays the info from a specific profile. That is to say, click on a member's name, and a page comes up displaying the information for the member, not a page that is member-specific. Clicking on any member name calls findmemberpage.cfm populated with data for foo rather than going to a member-specific page such as foo.cfm I have coded around this problem twice, but it still gets back to the same issue... variables. The first page has the following code. Yes, the @ sign is there for reasons you will see in the page resulting when the user clicks on any of the member buttons displayed. <cfset profile= "#getMembers.firstname# #getMembers.lastname#@"> <a href= "../profiles/findmemberprofile.cfm?Profile=<cfoutput>#getMembers.firstname# #getMembers.lastname#@</cfoutput>"> <input type = "submit" value="#getMembers.firstname# #getMembers.lastname#" Clicking on any button from the Members Page brings you to the following: The test code on the resulting findmembersprofile page is checking for the clicked on member name, and the cfoutput tags are there to see what is happening. When clicking on any given member name, the resulting URL.Profile starts with the member name clicked on, but then also includes all the following member names. To distinguish where one member name ends and the next begins, the @ sign is being used as a divider. Members names are never longer than 30 characters. <cfset rawprofilename = #left(#URL.Profile#,30)#> <cfoutput> #rawprofilename# </cfoutput> <cfset space=#find("@",'#rawprofilename#',0)#> <cfoutput> Character found at #space# </cfoutput> <cfset profilename = "<cfoutput>#left(rawprofilename,(space -1))#</cfoutput>"> <cfoutput> Profile to find is #profilename#. </cfoutput> So far, no problem... the clicked on members name is properly displayed from the #profilename# variable. Now, the following code never displays the user name or the profile status... I have put # signs, single quotes, double quotes, varying combinations and nothing around the variable profilename but I either get CFM error messages or nothing displayed. If I replace '#profilename#' with "foo" it works, but clicking on the profile for foo on the first (calling) page never displays the information. <cfquery name="gotProfile" datasource="cohv"> SELECT * FROM cohvclub WHERE cohvuser = '#profilename#' </cfquery> <cfoutput query= "gotProfile" > Member #gotProfile.cohvuser# Profile Status #gotProfile.profile# </cfoutput> Thanks again for your assistance. Viajero. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4889 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15 |
| Free embeddable forum powered by Nabble | Forum Help |