Skip to content

Instantly share code, notes, and snippets.

View camh96's full-sized avatar
Watching the game

Cam Hovell camh96

Watching the game
View GitHub Profile
<?php
function adminlogin()
{
// Login function code
}
if (adminlogin())
{?>
<h2>Welcome Admin</h2>
<a href=\"somescript.php\">Do some admin stuff!</a>
@camh96
camh96 / index.php
Created July 7, 2014 06:45
OB Site HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Cam">
<title>Oliver Bray Music</title>
@camh96
camh96 / invest.js
Last active August 29, 2015 14:03
Calculate shares
function insuffFunds() {
var txt;
var r = confirm("You probably don't have enough to purchase the miniumum amount, continue?");
if (r == true) {
alert("NOPE");
} }
function sharebuy(){
cash = prompt('How much money do you have?') // get cash amount
share = prompt('How much do shares cost?') //get share cost
#include<iostream>
#include<vector>
int main()
try {
std::vector<int> vec{3,4,3,1};
int i{vec.at(4)};
}
//An exception handler, catches std::out_of_range
catch(std::out_of_range& e) {
@camh96
camh96 / insertnews.php
Created June 6, 2014 01:44
News Database
<!doctype HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add to TC News</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<style>
body {
width: 1600px;
margin-right: auto;
<?php
// login as student, only select privilege
$username = "student";
$password = "";
$hostname = "127.0.0.1";
//connect
$con = mysqli_connect($hostname, $username, $password, 'news');
// check connection