There is a textarea element when reading and sending data through get to save to the database, the newline character is lost.

Code snippets: js

var message=$("#in_message").val(); $.get('chatpost.php?message='+message+); 

php

 $message=htmlspecialchars($_GET['message']); $message=mysql_escape_string($message); 

The line break character must be present in the database, but it is not. Perhaps this is due to the get request, and it is worth changing the line at the client, for example, message = message.replace(/\n/g, '/n'); but nothing happens either.

  • And where is the question in the question? - AivanF.
  • The line break character must be present in the database and it is not, perhaps it is connected with the get request and cost to change the line at the client, for example message = message.replace (/ \ n / g, '/ n'); but nothing happens either. - user209449
  • Here, it should be in question. - AivanF.
  • and you look at the incoming value. as I understand it get should not transfer line breaks. shield them in js - splash58
  • Those. get - ohm impossible to transfer line breaks, only to Post? - user209449

0