473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

showing mysql data as html wysisyg

Hi,

I'm using a database (mysql) called by php. The data is put in the $key variable.
This $key includes some html-code such as <B> or <BR> which I want to show not as <BR> but as html (wysisyg).

I believe the crux is found in this line (see also the code below):

Expand|Select|Wrap|Line Numbers
  1. textarea1 = document.getElementById('$key');
Normally I easily could add id='$key' in the <textarea> line for it to work, but this php file just shows the data and doesn't have any <textarea> code (it is not a form.php).

How do I have to tell ''textarea1'' what the data of $key is in order to show it on the webpage including the <B>, <BR> etc as html (richtext, wysiwyg) ??

i.e.:
Expand|Select|Wrap|Line Numbers
  1. textarea1 = $row[$key]
or something like that ?



[PHP]<font face='trebuchet, arial, HELVETICA' COLOR='$fntclr_1' size='-1'>
".$row[$key]." &nbsp;

<script language='JavaScript' type='text/javascript' src='wyzz/wyzz.js'></script>

<script type='text/javascript'>
function showHTML () {

// ref textarea
textarea1 = document.getElementById('$key');
// where to view HTML code
viewHtml = document.getElementById('div1');
// Finally get HTML output in div
viewHtml.innerHTML = textarea1.value ;

}
</script>

<BR>
<div id='div1' name='div1' style='position:relative;width:350px;height:200px; border:1px solid red;overflow:auto'></div>
<BR>
<input type='button' onclick='showHTML()' value='Voorbeschouwing'>[/PHP]
Oct 6 '07 #1
2 1340
pbmods
5,821 Expert 4TB
Heya, sunadumari.

Check out htmlentities().
Oct 6 '07 #2
thanx, I'll look into it. Nonetheless I believe that the mentioned line of code is the ''answer'' to my question?!
Oct 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: david | last post by:
Hello, i have html form for the user to input some french text. The text go in a mysql database * before: (mozilla-1.5) All my pages were designed to show themselves with the iso-8859-15...
1
by: Igor Slivka | last post by:
New problem ;). I got script running and showing projects, now i'm trying to show category for every project from another table. I want to do this in new page. Everything is fine except ;))... it...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
6
by: Viken Karaguesian | last post by:
Hello everyone, I'm just wondering what you all use to write and edit your HTML and organize your websites. I currently use Microsoft Frontpage 2003. Hold on! Before you all jump on me for...
3
by: auron | last post by:
Hi there, I have a really stupid and banal problem with showing the results of a MySQL query in PHP, preciselly with MySQL count() function that gives to a variable in PHP the result. NOTE:...
12
by: Trish | last post by:
I just had a bad experience using MS Word as an HTML editor. It bloated more than 200% so I could barely recognize the essential statements; and it introduced more than 14,000 errors. Also,...
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.