Skip to content

Instantly share code, notes, and snippets.

View brucenorton's full-sized avatar

Bruce Norton brucenorton

View GitHub Profile
@brucenorton
brucenorton / upload.js
Created May 7, 2017 22:11
cloudinary upload.js that works
$(function () {
"use strict";
$.post( "upload_tags.php", function( data ) {
$( "#uploadForm" ).html( data );
//The idea is to only load this once someone has filled out the form
let newContext = 'email=new@test.com|credits=Me New Context';
@brucenorton
brucenorton / upload.js
Created May 7, 2017 21:14
cloudinary PhotoAlbum dynamic context
$(function () {
"use strict";
//The idea is to only load this once someone has filled out the form
let newContext = 'email=new@test.com|credits=Me New Context';
$('.cloudinary-fileupload')
.cloudinary_fileupload({
dropZone: '#direct_upload',
context: newContext,
@brucenorton
brucenorton / shoes_insert.php
Created October 4, 2016 20:32
online store with modal
<?php
include '_includes/connect.php';
//echo("<br>insert.php");
$tbl = "customers";
//get posted info (if any)
if(!empty($_REQUEST["name"])){
$name = $_REQUEST["name"];
}
if(!empty($_REQUEST["email"])){
$email = $_REQUEST["email"];
@brucenorton
brucenorton / shoes_json.js
Created October 4, 2016 20:31
store with modals
//nortonb_shop
$( document ).ready(function() {
//load 'select'
$.getJSON( "shoes_json_encode.php", function( data ) {
showStore(data);
});
function showStore(data){
@brucenorton
brucenorton / select_category.php
Last active September 27, 2016 13:31
Filter by category (for Jason)
<?php
require_once '_includes/connect.php';
//added error reporting for debugging
error_reporting(E_ALL);
ini_set('display_errors', 'On');
//define table
$tbl = "items";//change to your table i.e. John_app
$tbl2 = "photos";
$tblCategories = "categories";
@brucenorton
brucenorton / select_join.php
Created September 14, 2016 12:53
hypertext 002 join items & photos
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bootstrap page</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
@brucenorton
brucenorton / shoes_styled.php
Last active September 12, 2016 18:57
add a bit of style to our shop
<!doctype html>
<html>
<head>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
@brucenorton
brucenorton / shoes_join.php
Created September 12, 2016 17:50
hypertext select join statement
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>php mySQLi prepared statments</title>
</head>
<body>
<!doctype html>
@brucenorton
brucenorton / select.php
Created September 6, 2016 19:32
updated select.php for php / mySQL unit
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>php mySQLi prepared statments</title>
</head>
<body>
<?php
@brucenorton
brucenorton / checkout.php
Created August 29, 2016 18:15
checkout file for Mihaela
<?php
require_once("_includes/connect.php");
$id = isset($_REQUEST['id'])?$_REQUEST['id']:'';
if(isset($_POST["item_id"])){
$item_id = $_POST["item_id"];
echo("item_id: ".$item_id);
}
if(isset($_POST["item_price"])){
$item_price = $_POST["item_price"];