Do I htmlencode?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Klaws_wolverine
Forum Commoner
Posts: 32
Joined: Mon Sep 29, 2003 10:11 am

Do I htmlencode?

Post by Klaws_wolverine »

Hello all,

I have a form, I collect the data, data is then being sent to an intermediate page and form data is kept inside hidden html tags.

Data is then sent to a Domino parser, problem is that whenever there are quotation marks "", the final output becomes a slash \.

Is this my fault, or is this a Domino issue? Do I have to htmlencode this field that contains a \ whenever there are quotation marks?

UPDATE: Ok, I used htmlspecialchars(), and it works a little better now. Before, all text ended at the slash. But now, text still continues, I see the quotation marks now, however... there are still slashes. So it's like: hello, my name is /"mk/". How do I get rid of these damn slashes?
$desc = htmlentities($description); and I also tried with ENT_Quotes

Please let me know, if so, a snippet of code would be apreciated!
Thanks
MK
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Could be magic_quotes_gpc. http://www.pinkgoblin.com/quotesarticle.php

You must htmlspecialchars before printing submitted data to a form field, but don't escape until you perform a db query.
Klaws_wolverine
Forum Commoner
Posts: 32
Joined: Mon Sep 29, 2003 10:11 am

encodding

Post by Klaws_wolverine »

Well, nothing goes to the db.
After all form data is sent to a domino parsing file, all data goes to someone's inbox.

It's in the inbox that I see the slashes. In order to see what was causing slashes, I found it was quotation marks, I put everything in the db as well as sent it to the inbox.

all is Ok in my db, but not in the inbox.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Did that link I gave you help?
spaace
Forum Newbie
Posts: 4
Joined: Wed Jan 28, 2004 11:46 am

Post by spaace »

Can you use urlencode() before you pass it.
Post Reply