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

HTML formatting

Status
Not open for further replies.

Dryvlyne

IS-IT--Management
Oct 15, 2004
25
US
Hello,

I'm pulling HTML marked up data from an Oracle DB using ColdFusion, however the HTML is not being applied to the data when it is pulled to the web page.

What am I missing?

Thanks
 
could you show some code? how does it happen? is there a query involved, and what does it look like? are you using a CFOUTPUT tag?

pretty hard to help you based on how little info you provided

:)

r937.com | rudy.ca
 
In the DB for example I have some data surrounded with bold tags and pull it to the web page using a simple SELECT statement within a CFQUERY before the opening HTML tag and then pull the variable into the BODY of the page using CFOUTPUT.

You know what... perhaps I just answered my own question here by explaining this to you. If my SELECT statement is happening before the opening HTML tag on the page then maybe that's why it isn't processing the HTML tags around the data in the DB. Hmm, if that's all it is then I'm going to feel really stupid.

I'm going to test this now... brb
 
Nope, that wasn't the problem.

So based on what I described, how can I get my HTML markup to work?
 
like this -- <CFOUTPUT>#queryname.htmlcolumn#</CFQUERY>

i'm sorry, you really haven't given us much to go on

you can run the CFQUERY anywhere on the page relative to the page's html tags as long as it's ahead of the CFOUTPUT that displays the database columns

r937.com | rudy.ca
 
Here's the code:

I have HTML markup stored in the DB surrounding the data in the posting_guidelines field.

Code:
<CFQUERY NAME="get_jobs" DATASOURCE="csoradb" USERNAME="chance03" PASSWORD="******">
SELECT posting_id, affiliate_name, annc_date, exp_date, position_title, dept_name, f_name, l_name, resp_level, salary, daily_duties, requirements, fulltime_parttime, hours, career_path, std_language.posting_guidelines, equal_op_lang 
FROM chance03.job_posting, chance03.affiliate, chance03.employee, chance03.department, chance03.std_language 
WHERE job_posting.affiliate_id = affiliate.affiliate_id AND
job_posting.dept_id = department.dept_id AND
job_posting.affiliate_id = department.affiliate_id AND
job_posting.supervisor = employee.emp_num AND
job_posting.posting_guidelines = std_language.std_lang_num AND
job_posting.equal_op = std_language.std_lang_num
ORDER BY affiliate_name
</CFQUERY>

<HTML>
<HEAD>
<TITLE>Job Posting Announcements</TITLE>


<style type="text/css">
<!--
body {
margin: 0;
padding: 0;
background-image: url(images/bg_scanlines.gif);
background-repeat: repeat;
}

#contentcontainer {
width: 750px; 
text-align: left; 
background-color: #FFFFFF; 
padding: 10px;
}

h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 1.5em;
font-weight: bold;
color: #00CC33;
text-align: center;
margin: 0;
padding: 0;
}

h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: .9em;
font-weight: bold;
text-align: center;
margin: 0;
padding: 0;
}

p {
font-family: Arial, Helvetica, sans-serif;
font-size: .8em;
margin: 0;
padding: 0;
}

.heading {
font-weight: bold;
}

-->
</style>
</HEAD>

<BODY>

<div align="center">
	<div id="contentcontainer">

		<H1>Job Posting Announcements</H1>
<CFOUTPUT>
     <h2>There are currently <span style="color: FF0000;">#get_jobs.RecordCount#</span> job opportunities available</h2>
</CFOUTPUT>

<CFOUTPUT QUERY="get_jobs">
<hr>
<p><span class="heading">Posting ID:</span> #posting_id#</p>
<p><span class="heading">Affiliate:</span> #affiliate_name#</p>
<p><span class="heading">Announcement Date:</span> #annc_date#</p>
<p><span class="heading">Expiration Date:</span> #exp_date#</p>
<p><span class="heading">Position Title:</span> #position_title#</p>
<p><span class="heading">Department:</span> #dept_name# </p>
<p><span class="heading">Supervisor:</span> #f_name# #l_name#</p>
<p><span class="heading">Responsibility Level:</span> #resp_level#</p>
<p><span class="heading">Salary:</span> #salary#</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">Daily Duties</span></p>
<p>#daily_duties#</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">Requirements</span></p>
<p>#requirements#</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">Schedule</span></p>
<p style="text-align: center;">This a #fulltime_parttime# position which requires approximately #hours# hours of work per week.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">Potential Career Path for this Position</span></p>
<p style="text-align: center;">#career_path#</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">Job Posting Guidelines</span></p>
<p>
#posting_guidelines#
</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span class="heading">PARK NATIONAL CORPORATION IS AN EQUAL OPPORTUNITY EMPLOYER:</span></p>
<p>#equal_op_lang#</p>
</CFOUTPUT>

</div>
</div>

</BODY>
</HTML>
 
that looks okay to me

you're saying that you can see the html tags in the displayed page?

could you maybe grab a few lines of the "view source" html after the page has been displayed?

r937.com | rudy.ca
 
If the DB content is: "<b> (value of posting_id) </b>"

Then the html portion is part of the value in #posting_id#

CF won't process it.

Write a function to strip the html from #posting_id# and apply the html code literally.

Lyndon
 
I have had similar experiences with embedding HTML source into a database and then pulling it into a cfm output. When i was doing this i didnt have any issues, if my database record said '<b>hello<b>' then the hello text would appear in bold on my rendered page.

Rob
 
r937 - When I do a view source after the page has been rendered I do not see the HTML tags that are embedded in the data in the DB.

Also, it has come to my attention that the application server where the ColdFusion is processed is a "Blue Dragon" server and not a Macrodmedia server. I don't know if that makes sense, but that's what I was told. Apparently there must be some differences between the two kinds of ColdFusion servers and perhaps this one can't do what I want.

Any suggestions on what I should try?
 
it does not sound like the application server has anything to do with it, coldfusion and bluedragon are both capable of querying html from a database with no problem. I would look for something simpler and more likely -

1) can you cfdump the query out and see if you see html where you expect to see it?

2) have you verified that the DSN is pointing to the same database that you see the html in? (i know a lot of times during development i'll have several databases and not be pointing to the right one with CF - basically be sure that the data you are looking at and the data CF is looking at is the same)

=========================================
Don't sweat the petty things and don't pet the sweaty things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top