- No categories
- All
Ajax not working to insert, query and result data
On my site, through a form I send/register same information in database, do a SELECT/query and return it! Return the last table saved in database, just that user just entered on the form (along with some more information coming from the database). How I want to display these values coming from databse in a modal bootstrap it's necessary that the page doesn't give the refresh. For this, I inserted the AJAX as follows: $(document).ready(function(){ $('#enviar').click(function(){ $.ajax({ //CAAL AJAX IN WORDPRESS url: 'wp-admin/admin-ajax.php', type: 'POST', //INSERT, QUERY AND DISPLAYS TO USER data: 'action=prancha', error: function(){ alert('ERRO!!!'); }, //IF OK, DISPLAYS TO USER IN DIV "RESULT" success: function(data){ $('#result').html(data); } }); }); }); MY FUNCTIONS.PHP: function prancha(){ header('Content-Type: text/html; charset=utf-8'); include "../../../wp-config.php"; /* DECLARING THE VARIABLES */ $nome = ""; $email = ""; $estilo = ""; $experiencia = ""; $altura = ""; … [Read more...] about Ajax not working to insert, query and result data
Learn More