Jump to content

htmlentities: secure enough form?


Gath

Recommended Posts

Hi.

 

Is

$reply_text = htmlentities ($reply_text, ENT_QUOTES);

secure enough for a query?

If not, why not?

I'm not very good at security, and might be missing some obvious stuff...

 

If it isnt, what i'm looking for is something that will secure the form (it's a message for a forum) but when showing it on a page, it comes out exactaly like it was typed. (pretty mutch like this forums  ;) )

 

Thank you.

Link to comment
Share on other sites

but when showing it on a page, it comes out exactaly like it was typed. (pretty mutch like this forums  ;) )

 

try viewing the source of the online page.;)

 

its pretty secure.. depends what of protection your after..

 

Yes, i keep inputting all weird combinations of symbols and such, checked the page, and it comes out alright.

 

What protection i'm after... hmm... well, to stop anything that could be done "against" the site/db, really  :)

sql injection, and anykind of 'exploit' to the code/db.

Link to comment
Share on other sites

yeah htmlentities should be fine

 

try this

$reply_text = 'Hello "world" that will be £1.99 please for Fish & chips';
$reply_text = htmlentities ($reply_text, ENT_QUOTES);
echo $reply_text;

 

it should view like this

Hello "world" that will be £1.99 please for Fish & chips

 

but if you "view source" it will show this

Hello "world" that will be £1.99 please for Fish & chips

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.