php - Issue with submitting form when "&" in description box -


This problem is happening in all of my forms, if in the description, a user has an ampersand symbol, then the page INSERT statement Displays with values, but does not move or send emails

For example:

"dog & amp; above the cat Quick brown fox jumps "will not work.

"

Insert a statement on one of the pages:

  $ filename = $ _GET ['filename']; $ size = $ _GET [ 'Failsiae']; $ date = $ _GET [ 'filed']; $ User = $ loggedin_id; $ desc = mysqli_real_escape_string ($ dbc3, $ _GET [ 'desc']); $ type = $ _GET ['Type']; $ ver = $ _GET ['Vir']; $ rev = $ _GET ['rev']; $ sql = "cad_files Choose lineup where job_num = $ job_id and file_type = 'dollar type' order date DESC LIMIT 1 "; $ result = mysqli_query ($ dbc3, $ sql); if (mysqli_num_rows ($ result) & lt; 1) {$ prev_lineup = 0;} and {$ prev_file = mysqli_fetch_assoc ($ result); $ prev_lineup = $ prev_file ['lineup'];} // $ type = getcadtype ($ type); $ navok Ri_aid = Hosibid ($ Naukri_nam, $ DBC 3); $ sql = "cad_files (Naukri_nam, user Fail_nav, file type, version, revision, date, size, insert description) VALUES ($ job_id, '$ user', ' $ Sql; mysqli_query ($ dbc3, $ sql); $ echo $ sql; $ ',' $ type ',' $ ver ',' $ rev ',' $ date ',' $ size ',' $ desc ' Or die (mysqli_error ($ dbc3)); $ id = mysqli_insert_id ($ dbc3);   

How can I resolve this issue?

Errors:

Warning: simplexml_load_string (): Entity: line 9: Analyst error: XmlParseEntityRef: Row / 15 / P /

Warning: simplexml_load_string (): & lt; P & gt; Details: & lt; Br / & gt; & Lt; There is no name in /home/xxxxx/public_html/main/includes/mail2.php. B & gt; Insert 3A & amp; 3b modified & lt; / B & gt; & Lt; / P & gt; On line 15 /home/xxxxx/public_html/main/includes/mail2.php

Warning: simplexml_load_string (): ^ / home / xxxxxx / public_html / main / includes / mail2.php line 15 < / p>

Catch able fatal error: simple 1MLToArray () should be an example to pass logic 1 SimpleXMLElement, has been bullion, on line /home/xxxxxx/public_html/main/includes/mail2.php 15 The call has been made and it is defined on /home/xxxxxx/public_html/main/includes/functions.php

Since you are sending everything to the query string (HTTP GET) , So you should avoid your variables before sending them to the server.

Use the javascript escape function such an encoding characters. You also need to decode them on the server side .

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -