Skip to content

Instantly share code, notes, and snippets.

@jimgwhit
jimgwhit / checkbox_array.md
Last active June 6, 2022 19:12
Checkbox array

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:
@jimgwhit
jimgwhit / Fetch_example.md
Last active June 23, 2021 20:02
Fetch simple example

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};
@jimgwhit
jimgwhit / db.php
Created May 16, 2021 20:29 — forked from luckyshot/db.php
PHP/MySQL (PDO Database) method with named parameters
<?php
/*
PHP/MySQL (PDO) method with named parameters
---------------------------------------------
https://gist.github.com/luckyshot/9477105
Last updated: 12 Sep 17
$config = [
@jimgwhit
jimgwhit / BlogController.php
Created July 29, 2021 18:58 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()