Execute php from javascript -
i'm having trouble getting php code working in app. setup rather easy: 1 button, 1 function , 1 php file.
script.js
$(document).ready(function () { $("#btntestconnectie").click(testconnectie); }); function testconnectie() { $.get("script/sql/testconnection.php"); }
testconnection.php
<?php echo "it works!"; php?>
according post, should work (how run php code when user clicks on link?)
some sources claim impossible execute php via javascript, don't know believe.
if i'm wrong, can point me method work (to connect javascript/jquery script mysql database)?
thanks!
$.get('script/sql/testconnection.php', function(data) { alert(data) });
you need process ajax result
Comments
Post a Comment