<!DOCTYPE html> <html> <body> <form action="" method="POST"> <input type="text" id="text"> <button type="button" id="send"> <script> $("#send").click(function() { var text = $("#text").val(); if (text != "") { $.ajax({ type: "GET", url: "request.php", data: { text: text }, cache: false, }); } }); </script> </body> </html>
<?php require("data.base.php");
<?php $dbhost = 'localhost'; $dbname = 'name'; $dbpass = 'password'; $dbuser = 'user';