> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/advanced/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/advanced/javascript/how-to-send-data-onclick-to-another-php-for-processing-using-post-or-get.md).

# how to send data onClick() to another php for processing using post or get?

C:\xampp\htdocs\ajaxsubmit\index.html

```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>
        $(function() {
      $("#Submit").click(function() {
        var value = jQuery("#txt").val();
        var data = jQuery('#myform_new').serializeArray();
        $.ajax({
          url: 'test1.php',
          type: 'POST',
          data: {param1: data},
          succes: function(succes) {
            console.log(succes);
          }
        });
      });
    });
    </script>
</head>
<body>
  <form id="myform_new">
    <input type="text" name="abc" value="abc" id="txt" />
    <input type="text" name="abc1" value="abc1" id="txt1" />
    <input type="button" name="Submit" id="Submit" value="Submit" />
  </form>
</body>
</html>
```
