472,958 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Html interpreation

I'm writing a little forum forum for my website. How can I avoid html code
interpretation if a user try to post it in the forum?

thnx
Jul 16 '05 #1
3 2061
sinapsi wrote:
I'm writing a little forum forum for my website. How can I avoid html code
interpretation if a user try to post it in the forum?

thnx

http://us3.php.net/manual/en/function.strip-tags.php

Jul 16 '05 #2
Sugapablo wrote:
sinapsi wrote:
I'm writing a little forum forum for my website. How can I avoid html
code interpretation if a user try to post it in the forum?

http://www.php.net/manual/en/function.strip-tags.php


This does not do what sinapsi is asking for. It removes HTML tags from the
input - which is completely different to stopping the HTML from being
rendered. What if you want to discuss HTML? It can get very annoying.

sinapsi, the problem is that your users are entering characters that HTML
treats in a special way, such as the less-than sign (<). The correct
solution is to encode these characters in one of the ways that HTML allows
you to (in the case of the less-than sign, this might be &lt;).

PHP provides the htmlentities() function that does this. Instead of:

echo($input);

....you want:

echo(htmlentities($input));

<URL:http://www.php.net/htmlentities>

--
Jim Dabell

Jul 16 '05 #3
sinapsi <in**@zam.it> wrote:
I'm writing a little forum forum for my website. How can I avoid html code
interpretation if a user try to post it in the forum?

thnx


htmlentities(), htmlspecialchars(), striptags()

http//php.net/manual

--
Eivind Lie Nitter
el*@gmx.net
http://ununique.net
Jul 16 '05 #4

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

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
6
by: Ludwig77 | last post by:
When I was first taught html several years ago, I was taught that the following tags are standard for any html formatted message: <HTML> <HEAD> </HEAD> </BODY> </HTML> In fact, I was taught...
4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
6
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.