Skip to content

Instantly share code, notes, and snippets.

@binaryfever
Created November 19, 2012 23:52
Show Gist options
  • Select an option

  • Save binaryfever/4114969 to your computer and use it in GitHub Desktop.

Select an option

Save binaryfever/4114969 to your computer and use it in GitHub Desktop.
Insert Customer HTML
<html>
<head>
<title>insert customer</title></pre>
<!-- include jquery library file-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#insert").click(function(){
//Get the input field values.
var name=$("#name").val();
var email=$("#email").val();
//use the $.post() method to call insert.php file.. this is the ajax request
$.post('insertcustomer.php', {name: name, email: email}, function(){
//you could put some succes message javascript here
});
return false;
});
});
</script>
</head>
<body>
<label>Name: </label> <input id="name" type="text" />
<label>E-Mail: </label> <input id="email" type="text" />
<a id="insert" title="Insert Data" href="#">Put into mysql</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment