Jump to content

[SOLVED] Messing up PHP


Ell20

Recommended Posts

Hi,

 

I have a messaging system where players can message each other in the game.

However if a player sends a message which contains --> there inbox dosent display correctly.

 

The code which sends the message to the database is:

 

$mailtext = addslashes(strip_tags($_POST['chat']));

 

Has anyone got any idea what I can do to stop this happening?

 

I have tried: - $mailtext = stripslashes(strip_tags($_POST['chat']));

                - $mailtext = stripslashes(trim($_POST['chat']))

 

But none of these combinations solved the problem.

 

Thanks for any help

 

Elliot

Link to comment
https://forums.phpfreaks.com/topic/80345-solved-messing-up-php/
Share on other sites

So something like this:

 

$mailtext = htmentities(ENT_QUOTES($_POST['chat']));

 

Thanks

 

ENT_QUOTES isn't a function, its a constant. It's meant to be used as such:

 

$text = htmlentities($_POST['chat'], ENT_QUOTES);

 

Also, to clarify, it's htmlentities, not htmentities (the L is crucial)

Link to comment
https://forums.phpfreaks.com/topic/80345-solved-messing-up-php/#findComment-407221
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.