php - $_GET method is not set even after passing a query string -
this jquery code:
<script type = "text/javascript"> $('document').ready(function(){ $('#mybutton').click(function(){ var querystring = $('frmemployee').serialize(); $.ajax({ url: 'anotherphp.php', type: 'get', data: querystring, success: function(){ alert('success!'); } }); }); }); </script>
after clicking mybutton, expect php code execute.
<?php require_once('db_connect.php'); if(isset($_get['f_name'])){ $f_name = $_get['f_name']; $m_name = $_get['m_name']; $l_name = $_get['l_name']; mysql_query("insert tbl_employee (f_name, m_name, l_name) values('$f_name','$m_name','$l_name')"); } ?>
my problem of $_get functions seems empty. can see address bar of data have passed (using serialize() method). why?
i see serialize $('frmemployee')
. need $('.frmemployee')
when class , $('#frmemployee')
when id.
propably sending empty query string now.
Comments
Post a Comment