Skip to content

Instantly share code, notes, and snippets.

View asathoor's full-sized avatar
:octocat:
Words! Words! Words! (Shakespeare)

Per Thykjaer Jensen (PETJ) asathoor

:octocat:
Words! Words! Words! (Shakespeare)
View GitHub Profile

Kode fra undervisning d. 2.10. 2017 CNT1

@asathoor
asathoor / action.php
Created September 26, 2017 10:17
Insert
<?php
/**
* file: action.php
* purpose: INSERT INTO
**/
$sql = "INSERT INTO `navne` (`navne_id`, `fornavn`, `efternavn`, `email`) VALUES (NULL, '" . $_GET['firstName'] . "', '".$_GET['lastName']."', '". $_GET['gender'] ."')";
echo $sql;
@asathoor
asathoor / README.md
Created September 26, 2017 06:22
SQL INSERT via PHP and HTML5 form

SQL INSERT via HTML5 form

A very basic form. Remember to include the HTML head section etc. - e.g. from boilerplate or similar.

Security

Cleanse the user input in action.php via:

$fn = addslashes( strip_tags( $fn ) );
@asathoor
asathoor / tjekdb.php
Created September 19, 2017 09:37
Mysql_cnt1
<?php
// CONNECT TO THE SAKILA DATABASE
$mysqli = new mysqli(
"localhost",
"root",
"mojndo",
"forta_cnt1"
); // creates the object
@asathoor
asathoor / README.md
Created August 9, 2017 21:11
Appjar GUI for g810-led

Appjar / Python GUI for Logitech g810-led

Dependencies:

Install appjar:

@asathoor
asathoor / radiowww.py
Created August 7, 2017 20:39
Simple Python WWW Radio Stream Player
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: test.py
# purpose: simple internet radio player for a pi or similar
# by: per thykjaer jensen
# dependencies: mplayer
'''
mplayer turns into a zombie on ctrl+z
if it's a problem kill them ...
@asathoor
asathoor / bootstrap
Created May 17, 2017 09:37
Bootstrap from W3
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
@asathoor
asathoor / guldsmed.js
Last active April 21, 2017 11:20
javascript-repetition
// egenskaber
var isbutik = {
adresse: "Paradisgade 121",
tlf: "12345678",
antalIspinde: 345,
};
isbutik.isMand = "Palle From";
isbutik.aaben = "09:00 - 23:30";
isbutik.harViAabenNu = true;
<!DOCTYPE html>
<html>
<body>
<head>
<title>Form sample</title>
</head>
<form action="#" method="get">
<label>Hvad mener du om ---?</label>
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 100px;
height: auto;
}
</style>