#mid(indexstring,x,1)# #mid(indexstring,X,1)# select sfxcount from qRecordCount where sfx = '#mid(indexstring,y,1)##mid(indexstring,x,1)#' #mid(indexstring,x,1)##mid(indexstring,y,1)#
#getSuffixCount.sfxcount# 0
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => FusionRed [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> #mid(indexstring,x,1)# #mid(indexstring,X,1)# #TRIM(prefix)##mid(indexstring,x,1)##mid(indexstring,y,1)#
I thought I defined "indexstring" with in the drill-down page. Red;-) [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => FusionRed [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> #mid(indexstring,x,1)##mid(indexstrin g,y,1)# [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 5 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Newbiew--Getting Dynamic Strings to pass as urls - Macromedia ColdFusion

Newbiew--Getting Dynamic Strings to pass as urls - Macromedia ColdFusion

I've been trying to get a form which creates a table with the following code to pass the created string as a url. This doesn't pass by using an <ahref> inside the output tags. Since I've no experience with this maybe someone could offer a suggestion? <form action="PID2PCN.cfm" method="post"> <table border="2" cellspacing="0" bordercolor="#993300" bgcolor="#FFFFCC"> <cfset indexstring = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"> <tr> <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica, sans-serif">Suffix</font></th> <cfloop index="x" from="1" to="36"> <!--- header loop ---> <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica, sans-serif"><cfoutput>#mid(indexstring,x,1)#</cfoutput></font></th> </cfloop> </tr> <cfloop index="x" from="1" to="36"> <!--- row loop ---> <tr> <th><strong><font color="#993300" size="2" face="Verdana, Arial, Helvetica, sans-serif"><cfoutput>#mid(indexstring,X,1)#</cfoutput></font></strong></th> <cfloop ...

  1. #1

    Default Newbiew--Getting Dynamic Strings to pass as urls

    I've been trying to get a form which creates a table with the following code to
    pass the created string as a url. This doesn't pass by using an <ahref> inside
    the output tags. Since I've no experience with this maybe someone could offer
    a suggestion?

    <form action="PID2PCN.cfm" method="post">

    <table border="2" cellspacing="0" bordercolor="#993300" bgcolor="#FFFFCC">
    <cfset indexstring = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ">
    <tr>
    <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica,
    sans-serif">Suffix</font></th>
    <cfloop index="x" from="1" to="36">
    <!--- header loop --->
    <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica,
    sans-serif"><cfoutput>#mid(indexstring,x,1)#</cfoutput></font></th>
    </cfloop>
    </tr>
    <cfloop index="x" from="1" to="36">
    <!--- row loop --->
    <tr>
    <th><strong><font color="#993300" size="2" face="Verdana, Arial,
    Helvetica,
    sans-serif"><cfoutput>#mid(indexstring,X,1)#</cfoutput></font></strong></th>
    <cfloop index="Y" from="1" to="36">
    <!--- column loop --->
    <cfquery dbtype="query" name="getSuffixCount">
    select sfxcount from qRecordCount where sfx =
    '#mid(indexstring,y,1)##mid(indexstring,x,1)#'
    </cfquery>
    <td><strong><font color="#993300" size="2" face="Verdana, Arial,
    Helvetica,
    sans-serif"><cfoutput>#mid(indexstring,x,1)##mid(indexs tring,y,1)#<br>
    <cfif getSuffixCount.recordcount eq 1>
    #getSuffixCount.sfxcount#
    <cfelse>
    0
    </cfif>
    </cfoutput></font></strong></td>
    </cfloop>
    <!--- end column loop --->
    </tr>
    </cfloop>
    <!--- end row loop --->
    </table>


    </form>

    FusionRed Guest

  2. #2

    Default Re: Newbiew--Getting Dynamic Strings to pass as urls

    I'm not sure if I'm understanding you correctly, but if you want the dynamic
    string to appear as a link, then you need to use an < a href > tag, like ...

    < a href="goToSomePage.cfm" >#mid(indexstring,x,1)##mid(indexstring,y,1)# <
    /a >

    Which part of the URL link is dynamic? The page, page parameters or just the
    displayed title for the link?


    mxstu Guest

  3. #3

    Default Re: Newbiew--Getting Dynamic Strings to pass as urls

    Many thanks for your input.

    When I use <a href> i.e.:

    <cfoutput><a
    href="PID2PCN.cfm?prefix=qGetPCN.prefix">#mid(inde xstring,x,1)##mid(indexstring,
    y,1)#</a>

    I get the table with links when I click the link I get the following error:

    Variable INDEXSTRING is undefined.


    The Error Occurred in C:\CFusionMX\wwwroot\GetEmployee\PID2PCN.cfm: line 8

    6 : </cfquery>
    7 :
    8 : <cfset prefix = indexstring>
    9 :
    10 : <html>




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

    Please Try The Following:

    Check the CFML Reference Manual to verify that you are using the correct
    syntax.

    Search the Knowledge Base to find a solution to your problem.


    Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
    Remote Address 127.0.0.1
    Referer [url]http://localhost:8500/getemployee/FormPID.cfm[/url]
    Date/Time 27-May-05 04:39 PM

    Stack Trace (click to expand)
    at
    cfPID2PCN2ecfm446031255.runPage(C:\CFusionMX\wwwro ot\GetEmployee\PID2PCN.cfm:8)


    coldfusion.runtime.UndefinedVariableException: Variable INDEXSTRING is
    undefined.
    at coldfusion.runtime.CfJspPage._get(Unknown Source)
    at coldfusion.runtime.CfJspPage._autoscalarize(Unknow n Source)


    The error is produced when I click on the link to go to the following page
    code:

    <cfquery name="qGetPCN" datasource="CopyPCN">
    SELECT pcn.ref, pcn.sfx, pcn.ci
    FROM pcn
    WHERE pcn.sfx='#URL.prefix#'
    ORDER BY pcn.ref
    </cfquery>

    <cfset prefix = indexstring>

    <html>
    <head>
    <title>PID Drill Down Search</title>
    <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    </head>

    <body>

    <form action="PIDdrilldown.cfm" method="post">

    <table border="2" cellspacing="0" bordercolor="#993300" bgcolor="#FFFFCC">
    <cfset indexstring = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ">
    <tr>
    <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica,
    sans-serif">Prefix</font></th>
    <cfloop index="x" from="1" to="36">
    <!--- header loop --->
    <th><font color="#993300" size="2" face="Verdana, Arial, Helvetica,
    sans-serif"><cfoutput>#mid(indexstring,x,1)#</cfoutput></font></th>
    </cfloop>
    </tr>
    <cfloop index="x" from="1" to="36">
    <!--- row loop --->
    <tr>
    <th><strong><font color="#993300" size="2" face="Verdana, Arial,
    Helvetica,
    sans-serif"><cfoutput>#mid(indexstring,X,1)#</cfoutput></font></strong></th>
    <cfloop index="Y" from="1" to="36">
    <!--- column loop --->
    <!--- <cfquery dbtype="query" name="getSuffixCount">
    select sfxcount from qRecordCount where sfx =
    '#mid(indexstring,y,1)##mid(indexstring,x,1)#'
    </cfquery> --->
    <td><strong><font color="#993300" size="2" face="Verdana, Arial,
    Helvetica, sans-serif"><cfoutput><!---
    #mid(indexstring,x,1)##mid(indexstring,y,1)#
    --->#TRIM(prefix)##mid(indexstring,x,1)##mid(indexstr ing,y,1)#<br>
    <!--- <cfif getSuffixCount.recordcount eq 1>
    <a
    href="PID2PCN.cfm?sfxcount=Variables.sfxcount=#get SuffixCount.sfxcount#">#getSuf
    fixCount.sfxcount#</a>
    <cfelse>
    0
    </cfif> --->
    </cfoutput></font></strong></td>
    </cfloop>
    <!--- end column loop --->
    </tr>
    </cfloop>
    <!--- end row loop --->
    </table>


    </form>
    I thought I defined "indexstring" with <cfset prefix = indexstring> in the
    drill-down page.

    Red;-)



    FusionRed Guest

  4. #4

    Default Re: Newbiew--Getting Dynamic Strings to pass as urls

    As an update: when I remove the <cfset prefix=indexstring> it passes the
    indexstring, but doesn't build the last two digits of the table and includes
    code in the output.

    Prefix 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    0 qGetPCN.prefix00
    qGetPCN.prefix01
    qGetPCN.prefix02
    qGetPCN.prefix03
    qGetPCN.prefix04
    qGetPCN.prefix05
    qGetPCN.prefix06
    qGetPCN.prefix07
    qGetPCN.prefix08
    qGetPCN.prefix09
    qGetPCN.prefix0A
    qGetPCN.prefix0B
    qGetPCN.prefix0C
    qGetPCN.prefix0D
    qGetPCN.prefix0E
    qGetPCN.prefix0F
    qGetPCN.prefix0G
    qGetPCN.prefix0H
    qGetPCN.prefix0I
    qGetPCN.prefix0J
    qGetPCN.prefix0K
    qGetPCN.prefix0L
    qGetPCN.prefix0M
    qGetPCN.prefix0N
    qGetPCN.prefix0O
    qGetPCN.prefix0P
    qGetPCN.prefix0Q
    qGetPCN.prefix0R
    qGetPCN.prefix0S
    qGetPCN.prefix0T
    qGetPCN.prefix0U
    qGetPCN.prefix0V
    qGetPCN.prefix0W
    qGetPCN.prefix0X
    qGetPCN.prefix0Y
    qGetPCN.prefix0Z

    1 qGetPCN.prefix10

    I know this problem is due to the variable, but I'm not sure how to correct
    it????

    Thanks to all who help!;-)

    Red


    FusionRed Guest

  5. #5

    Default Re: Newbiew--Getting Dynamic Strings to pass as urls

    1) " ... I thought I defined "indexstring" with <cfset prefix = indexstring> in
    the drill-down page ..."

    Well, at the top of the page you try and assign the value of "indexstring" to
    prefix:
    < cfset prefix = indexstring >
    It doesn't look like that variable was defined in that page yet... unless it
    was passed in the URL. That's why you received the error

    2) RE: "As an update: when I remove the <cfset prefix=indexstring> it passes
    the indexstring, but doesn't build the last two digits of the table and
    includes code in the output.

    Prefix 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    0 qGetPCN.prefix00 .."

    I think you accidentally commented out some of the code you need in the table
    sell. Also, since "qGetPCN.prefix" is actually a query value, you need to put
    pound (#) signs around it so that Cold Fusion will evaluate it. Note: it
    doesn't look like the "prefix" column is included in the SQL of the "qGetPCN"
    query, so that might cause an error.





    <!--- Must sure to add "prefix" column to the "qGetPCN" query ---->
    <a
    href="PID2PCN.cfm?prefix=#qGetPCN.prefix#">#mid(in dexstring,x,1)##mid(indexstrin
    g,y,1)#</a>

    mxstu Guest

Similar Threads

  1. Pass Dynamic Variable in MM:DataSet
    By ralerta in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 8th, 07:11 PM
  2. Making XMLConnector URLs dynamic
    By vandenI3urg in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: March 21st, 06:20 PM
  3. dynamic URLS convert to static URLS for search engines
    By Steve T. in forum ASP.NET Web Services
    Replies: 7
    Last Post: March 4th, 03:16 PM
  4. pass dynamic checkbox values to results page?
    By Usergroup User webforumsuser@macromedia.com in forum HTML & CSS
    Replies: 8
    Last Post: September 22nd, 06:12 PM
  5. rb_raise with dynamic strings and GC
    By Dan Janowski in forum Ruby
    Replies: 1
    Last Post: August 2nd, 12:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •