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

ColdFusion Function, need help.. Urgent

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I am writing this email asking for help regarding the REFind() Function in ColdFusion.
The problem is that I am trying to integrate a cart system within our web site, but the guy who wrote the pages before wrote a .cfm page called PageSelector.cfm.

If you want to buy an item, you click on the item and it brings you to Item-Detail Page.
If the ItemID is 43523
Then the url will be
But "43523.html" is a virtual file, it doesnt really exist on the server, the PageSelector.cfm file dynamicaly creates this virtual file in the url, even though it doesn't physically exist.

But I need to find where that page is stored.
Here is the code that is used to create this virutal file.

<cfset st = REFind(&quot;items/([0-9]+)-([0-9]+)&quot;,QUERY_STRING,1,&quot;TRUE&quot;)>
<cfif ArrayLen(st.pos) LT 3>
<cfset st = REFind(&quot;items/([0-9]+)&quot;,QUERY_STRING,1,&quot;TRUE&quot;)>
</cfif>

<cfif ArrayLen(st.pos) GT 1>
<cfset ItemID = Mid(QUERY_STRING,st.pos[2],st.len[2])>
<cfif ArrayLen(st.pos) eq 3>
<cfset CatID = Mid(QUERY_STRING,st.pos[3],st.len[3])>
</cfif>

<cfset st = REFind(&quot;cats/([0-9]+)-?([0-9]*)-?([0-9]*)-?([a-zA-Z0-9]*).html&quot;,QUERY_STRING,1,&quot;TRUE&quot;)>
<cfif ArrayLen(st.pos) GTE 2>
<cfset CatID = Mid(QUERY_STRING,st.pos[2],st.len[2])>
<cfif ArrayLen(st.pos) GTE 3>
<cfif st.len[3] GT 0><cfset CatLvl = Mid(QUERY_STRING,st.pos[3],st.len[3])></cfif>
</cfif>
<cfif ArrayLen(st.pos) GTE 4>
<cfset MallID = Mid(QUERY_STRING,st.pos[4],st.len[4])>
</cfif>
<cfset frmAction=&quot;tab1&quot;>
<cfif ArrayLen(st.pos) GTE 5>
<cfif st.len[5] GT 0><cfset frmAction = Mid(QUERY_STRING,st.pos[5],st.len[5])></cfif>
</cfif>

Can anyone help me out. I need to find where this page really exists so I can put my ADD TO CART, UPDATE CART jpeg files. I cannot find it at all.

I don't understand REfind well enough to understand the syntax used above.

Please help
Thank You
MK
 
Unless I am missing something, if the page is created dynamically, there should be a <cffile> command somewhere to create the page. The only dumb questions are the ones that are never asked
 
There is no CFFILE because the file doesn't exist, it's a virtual file, it doesn't physically exist, only in the url does it exist, nowhere else.
 
Hello,

if i'm not mistaken, the codes only show how the link can be created (string manipulation) based on the item selected. No more no less! Are you sure 43523.html does not exist? You know that &quot;item&quot; can be a virtual directory, right? It might not even be on the local server when you do a search for it... Look into possibility of him using CFINCLUDE which might have another routine handling the task, also pay attention to CFOUTPUT. I don't think he can show any item without CFOUTPUTting to either a file or screen...

good luck!

AP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top