Mój kod wygląda tak.
Index.php
script.js
function addRecord() { var opis = $("#opis").val(); opis = opis.trim(); if (opis == "") { alert("opis jest wymagany!"); } else { $.post("ajax/create.php", { opis: opis }, function (data, status) { $("#dodaj_nowy_rekord_modal").modal("hide"); readRecords(); $("#opis").val(""); }); } }
create.php
require("lib.php"); $opis = filter_input(INPUT_POST, 'opis', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $object = new CRUD(); $object->Create($opis); }
Wiecie może czego brakuje w index.php i skrypcie js żeby poprawnie wysyłało ?