forms - Jquery UI insert to mysql error -


i making script insert country db, not work @ all, have tried in many ways, not run. test php code , insert correct, modal window works, can not insert country modal form. english not good, maybe understand me better code, in advance

form

<div id="dialog-form" title="insertar pais">         <form name="registeracc" id="registeracc" action="insertpais.php" method="post">             <input required type="text" id="pais" name="pais" class="span2" />         </form> </div> 

script

            $(function(){             var username=$("#pais").val();             $( "#dialog-form" ).dialog({                 autoopen: false,                 height: 200,                 width: 600,                 modal: true,                 buttons: {                     "registrar": function() {                             $.post("insertpais.php", { pais: "pais"} );                         $(this).dialog("close");                     }//end function                 }//end buttons             });//end dialog     </script> 

insertpais.php

include("database.inc.php");     if(isset($_get['pais']) ){ $pais = $_get['pais']; $sql="insert countries (id,iso,name) values ('','','$pais')"; mysqli_query($link2,$sql); } 


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -