First, in html if a checkbox is not checked nothing is passed for that checkbox in the request.
For example if you had a form with name and likes, (pick from the following)
Name ________________
I like:
First, in html if a checkbox is not checked nothing is passed for that checkbox in the request.
For example if you had a form with name and likes, (pick from the following)
Name ________________
I like:
Just test data and uptating one field using put:
document.getElementById('submitBtn').addEventListener('click', submitPost);
function submitPost(e) {
e.preventDefault();
const data = {petid: document.getElementById('petid').value,
species: document.getElementById('species').value,
_token: document.getElementsByName("_token")[0].value,
_method: document.getElementsByName("_method")[0].value};
<?php | |
/* | |
PHP/MySQL (PDO) method with named parameters | |
--------------------------------------------- | |
https://gist.github.com/luckyshot/9477105 | |
Last updated: 12 Sep 17 | |
$config = [ |
<?php | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |