You are here:

ColdFusion Programming/Hyperlink Problem while adding it dynamically

Advertisement


Question
I am adding hyperlink href dynamically taking it from db. like below:
<a href="#qVerify.sPath#">HOME</a></li>
where qVerify is the query for retrieving the records. But the result output html is like this:
<a href="localhost/sincla/index.cfm#qVerify.sPath#">HOME</a></li>

How do i get rid of the variable names and # coming along with the value.

Please help me. I am newbie to CF, and working in dreamweaver. Thanks in advance

Answer
Aloha,
First off, your links should NOT have "localhost" in them. That will tell the browser to look on the local computer of whoever is viewing the page. The link needs to point to a page on the host server in your website.

What you need to do is just look at what is actually in the database. It would appear that #qVerify.sPath# is inside the field along with the rest of it.

So just do this:

<cfoutput query="qVerify">
#sPath#<br>
</cfoutput>

And see what comes out of your query.

ColdFusion Programming

All Answers


Answers by Expert:


Ask Experts

Volunteer


Donald Hammond

Expertise

Expert in ColdFusion, Flash ActionScript, XML, and SQL.

Experience

Cold Fusion, Flash Action Script

©2012 About.com, a part of The New York Times Company. All rights reserved.