Hi Gary

 

You gave me the right answer and have scored 10 points! Thanks a lot for
that:)))

 

BTW as you may have guest, it is a PHP web-app.

 

John C

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Gary T. Benner
Sent: Tuesday, 4 August 2009 9:57 p.m.
To: [email protected]
Cc: [email protected]
Subject: Re: [DUG-Offtopic] Web question

 

[Reply] 

HI all, 

And with PHP just use the htmlentities() function on the incoming text. 

cheers 

Gary 

At 20:58 on 4/08/2009 you wrote 

>To : [email protected] 

>CC : 

>From: Jeremy Coulter, [email protected] 

>Content Type: text/html 

>Attached: 

> 

>This is a multi-part message in MIME format. 

> 

> 

> 

> 

>This is a fairly common issue. Fortunutly the answer is res. straight 

>forward. 

>I am not sure what language you are using, but using VBScript in an ASP
page 

>you would use Server.HTMLEncode(yourtext) when you save it, then you the 

>following function to decode it when you want to display the data. 

>I am sure there are a few other ways to do it, but I know I have used 

>before. 

> 

>Jeremy 

> 

> 

>Function HTMLDecode(sText) 

> 

> Dim I 

> 

> sText = Replace(sText, """, Chr(34)) 

> 

> sText = Replace(sText, "<" , Chr(60)) 

> 

> sText = Replace(sText, ">" , Chr(62)) 

> 

> sText = Replace(sText, "&" , Chr(38)) 

> 

> sText = Replace(sText, " ", Chr(32)) 

> 

> For I = 1 to 255 

> 

> sText = Replace(sText, "&#" & I & ";", Chr(I)) 

> 

> Next 

> 

> HTMLDecode = sText 

> 

>End Function 

> 

> _____ 

> 

>From: [email protected] 

>[mailto:[email protected]] On Behalf Of PDS - John 

>Sent: 4 August 2009 20:34 

>To: [email protected] 

>Subject: [DUG-Offtopic] Web question 

> 

> 

> 

>Hi 

> 

> 

> 

>I have a web application where people can submit questions. A smart "IT - 

>joker" could enter the text "</table>" screwing the whole page:( 

> 

>What can I do to prevent this "unwanted feature" and just showing the text 

>as such? 

> 

> 

> 

>John C 

> 

> 

> 

>_______________________________________________ 

>NZ Borland Developers Group Offtopic mailing list 

>Post: [email protected] 

>Admin: http://delphi.org.nz/mailman/listinfo/offtopic 

>Unsubscribe: send an email to [email protected] with
Subject: unsubscribe



Gary Benner 

  _____  


 <http://www.semantic.co.nz> Semantic Limited - Online Education,
e-Commerce, Software Development & Systems Design

 <http://www.123.net.nz> 123 Internet Limited - Managed Web Hosting,
Virtualisation, High Availability Systems & Cluster Technologies

Mob: 021 966 992

DDI: +64 7 543 1206

Email: [email protected]

Skype: garybenner



Ref#: 41006

_______________________________________________
NZ Borland Developers Group Offtopic mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/offtopic
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to