Javascript Ajax Php kein Wert?
Console:
HTML javascript Code ajax:
function send(text){
console.log("Text kurz vor versenden:\n" +text);
//hier hat er noch einen wert
$.ajax({
method: "POST",
url: "DataSender.php",
data: { text: text}
}).done(function( response ) {
console.log(response);
console.log("weiterleitung
Php Code Ajax Übertragung wo es nicht geht:
$text = $_POST['text'];
$sql = "INSERT INTO `Xss-Data` (`ID`,`DATA`, `created_at`) VALUES (null, '{$text}' , CURRENT_TIMESTAMP)";
if (empty($text)) {
//das ist empty!
echo("Error:\nEs ist leer\nText wäre\n$text");
} else
Sind die wichtigen Code snippets
Der String hat keinen Wert. Warum? Wie löst man das?
