gists/send-post-form-by-js/test.php

7 lines
235 B
PHP

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') var_dump($_POST);
echo <<<HTML
<button onclick="sendPostWithData('test.php', {name: 'John', surname: 'Doe'})">Send</button>
<script src="script.js"></script>
HTML;