473,387 Members | 1,574 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,387 software developers and data experts.

Displaying database contents on the web

FP
I have a comments field in my database that I want on the web.
I put some weird characters in for testing.
When I had <bin the comment field it turned all text after that bold.
I tried using htmlspecialchars() & htmlentities() but then I got
"”" instead of a quote.

The code I'm using to display the text in HTML is:
<TD>
<P><FONT SIZE="+1">
<? echo(htmlentities($ResultOne['Comment'][0])); ?>
</FONT></P>
</TD>

Do I need to change the HTML code or is there a PHP function that will
handle all weird characters in this situation? Please keep in mind I'm
fairly new to this, so if there's an obvious answer just point me in
the right direction.

P.S.
Someone had suggested using a regex function but I couldn't find that
in my manual, I assumed they were referring to the htmlspecialchars()
function.

Jul 6 '06 #1
1 958
For clarification, I take it that you want your quotes to remain as
quotes, and not become html entities. You were close, just use the
following

htmlentities( $str, ENT_NOQUOTES ); // leaves ' and " as they are
FP wrote:
I have a comments field in my database that I want on the web.
I put some weird characters in for testing.
When I had <bin the comment field it turned all text after that bold.
I tried using htmlspecialchars() & htmlentities() but then I got
"”" instead of a quote.

The code I'm using to display the text in HTML is:
<TD>
<P><FONT SIZE="+1">
<? echo(htmlentities($ResultOne['Comment'][0])); ?>
</FONT></P>
</TD>

Do I need to change the HTML code or is there a PHP function that will
handle all weird characters in this situation? Please keep in mind I'm
fairly new to this, so if there's an obvious answer just point me in
the right direction.

P.S.
Someone had suggested using a regex function but I couldn't find that
in my manual, I assumed they were referring to the htmlspecialchars()
function.
Jul 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
3
by: Mike Turco | last post by:
I have an Access database that holds a catalog and one of the fields contains the HTML for the web page. The HTML code is very simple. I would like to be able to display that HTML output on an...
5
by: Tomaz Koritnik | last post by:
Hi I have many short HTML files stored in a binary stream storage to display descriptions for various items in application. HTML would be display inside application using some .NET control or...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
2
by: naijacoder naijacoder | last post by:
I want to have a asp page that would be displaying different contents depending on the user that logged in. And the data would be populated from the Database! Any ideas on how to do this ***...
2
by: Jeronimo Bertran | last post by:
Hello, I am using a rendering aspx page to display a database image on an Image control. When the database record is retrieved, I am saving the bitmap to a session variable for the rendering...
6
by: Al Wilkerson | last post by:
Hi, Does anyone know how to display the contents of a DataGrid on another aspx page. I have a aspx page that when the user clicks on a link button the database is queried and I want the results...
5
by: Brad Baker | last post by:
I'm completely new to ASP.NET programming, so please accept my apologies in advance for asking what is probably an obvious question. :-) I'm trying to write a page which will display the...
2
by: xtremebass | last post by:
Hi , i have created table with only one field for the type of varchar(8000) . I am stroed bulk amount of data in that field. The size i have specified is enough for the field to occupy my data....
13
by: xtremebass | last post by:
Hi , i have created table with only one field for the type of varchar(8000) . I am stroed bulk amount of data in that field. The size i have specified is enough for the field to occupy my data....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.