Mam taki problem, że podczas gdy usuwam tekst z inputa to on nie usuwa tego z pliku baza.txt.
A gdy coś piszę i zmieniam to wszystko jest OK.
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Untitled 3</title> </head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("input[name='sum']").keyup(function() { var menuId = $("input[name='sum']").val(); $.ajax({ url: "a.php", type: "POST", data: {id : menuId}, success: function(msg) { $("div#response").text(msg); } }); }); }); </script> <body> <form action="index.php" method="POST"> <input type="text" name="sum" value=""><br> <div id="response"></div> <input type="submit"> </form> </body> </html>
a.php
<?php ?>
Czyli:
Piszę sobie tekst: aaabbbccc to jest OK i dodaje, ale gdy go usuwam(z inputa) to on zostaje dalej w baza.txt, a ja chcę zrobić tak, że gdy usuwam z inputa to usuwa się też z baza.txt