> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/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/javascript/jquery-redirect-with-post-get-data-php-ok.md).

# jQuery - Redirect with post, Get data php (ok)

A simple HTTP POST and GET Redirection Plugin for jQuery

* Easy to use
* GET and POST requests
* Compatible with jQuery, jQlite and Zepto.js
* Supports nested objects and arrays

**Ví dụ đã hoàn thành**

```
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script type="text/javascript" src="jquery.redirect.js"></script>
</head>
<body>
    <button type="button" name="button">TEST</button>
    <script type="text/javascript">
    //Log instead of redirect for testing purposes
    jQuery(function($) {
      $("button").click(function() {
        $.redirect("http://localhost/ajaxsubmit/test.php",
        [{
          user: "johnDoe",
          password: "12345",
          submit: "name",
          phones: [
            { area: "11", number: "4444444" },
            { area: "22", number: "5555555" }
          ]
        }, 
        {
          user: "gastonJones",
          password: "5431",
          submit: "Gastón Jones",
          phones: [
            { area: "11", number: "41321" }
          ]
        }],
        "POST", null, null, true);
      });
    });
    </script>
</body>
</html>
```

C:\xampp\htdocs\ajaxsubmit\test.php

```
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <?php  
    echo "<pre>";
    var_export($_POST);
  ?>
</body>
</html>
```

![](/files/zDwkq2DrWqf4NsRFWLOn)

C:\xampp\htdocs\ajaxsubmit

{% file src="/files/GtyD8pa6V5wepoZjmc6L" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://javascriptuse.gitbook.io/javascript/jquery-redirect-with-post-get-data-php-ok.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
