[Solved] angle bracket mysql php [duplicate]


The output of from_addr will be there if you are receiving results from your query.

Take a look at this example:

$string = '<hello world>';
echo $string;
echo htmlspecialchars('<hello world>');

Whereas, echo $string will show in the source code, but is being treated as a tag, and therefore not display “on screen”.

Using the htmlspecialchars() will change < > to &lt; &gt; which will show “on screen”.

It appears that you are using this field for email, so I would NOT recommend saving to the database with htmlspecialchars, as you want the emails to send properly.

If the above didn’t answer your question fully, and you wish to query the database for an email rather than the “send name”, I would recommend using LIKE:

SELECT * FROM `msgs` WHERE `from_addr` LIKE '<%INSERT_EMAIL_ADDRESS%>'.

Hope this helps.

2

solved angle bracket mysql php [duplicate]