From b9bcf5c949c7941d2d2435aadd28af27f1b1fd63 Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Fri, 10 Jul 2015 09:47:15 +0100 Subject: [PATCH] update --- PicUpload.php | 12 ++++++++++++ Update.bat | 3 +++ mousetrap.min.js | 11 +++++++++++ read.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ upload.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 PicUpload.php create mode 100644 Update.bat create mode 100644 mousetrap.min.js create mode 100644 read.php create mode 100644 upload.php diff --git a/PicUpload.php b/PicUpload.php new file mode 100644 index 0000000..ba900a3 --- /dev/null +++ b/PicUpload.php @@ -0,0 +1,12 @@ + + + + +
+ Select image to upload: + + +
+ + + \ No newline at end of file diff --git a/Update.bat b/Update.bat new file mode 100644 index 0000000..1d9e7c9 --- /dev/null +++ b/Update.bat @@ -0,0 +1,3 @@ +git.exe stash +git.exe pull +git.exe stash pop \ No newline at end of file diff --git a/mousetrap.min.js b/mousetrap.min.js new file mode 100644 index 0000000..291aff8 --- /dev/null +++ b/mousetrap.min.js @@ -0,0 +1,11 @@ +/* mousetrap v1.5.3 craig.is/killing/mice */ +(function(C,r,g){function t(a,b,h){a.addEventListener?a.addEventListener(b,h,!1):a.attachEvent("on"+b,h)}function x(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return l[a.which]?l[a.which]:p[a.which]?p[a.which]:String.fromCharCode(a.which).toLowerCase()}function D(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function u(a){return"shift"==a||"ctrl"==a||"alt"==a|| +"meta"==a}function y(a,b){var h,c,e,g=[];h=a;"+"===h?h=["+"]:(h=h.replace(/\+{2}/g,"+plus"),h=h.split("+"));for(e=0;em||l.hasOwnProperty(m)&&(k[l[m]]=m)}e=k[h]?"keydown":"keypress"}"keypress"==e&&g.length&&(e="keydown");return{key:c,modifiers:g,action:e}}function B(a,b){return null===a||a===r?!1:a===b?!0:B(a.parentNode,b)}function c(a){function b(a){a= +a||{};var b=!1,n;for(n in q)a[n]?b=!0:q[n]=0;b||(v=!1)}function h(a,b,n,f,c,h){var g,e,l=[],m=n.type;if(!d._callbacks[a])return[];"keyup"==m&&u(a)&&(b=[a]);for(g=0;g":".","?":"/","|":"\\"},z={option:"alt",command:"meta","return":"enter", +escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k;for(g=1;20>g;++g)l[111+g]="f"+g;for(g=0;9>=g;++g)l[g+96]=g;c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={};this._directMap= +{};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||B(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.init=function(){var a=c(r),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};c.init();C.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports= +c);"function"===typeof define&&define.amd&&define(function(){return c})})(window,document); diff --git a/read.php b/read.php new file mode 100644 index 0000000..baccbf7 --- /dev/null +++ b/read.php @@ -0,0 +1,45 @@ + $value) { + echo "$key => $value"; + $config[$key] = trim($value); //here you can add a filter, like htmlentities ... + echo $config; + } + + return $config; + +} +?> + + + +
+ $value) { + echo ""; + echo "

"; +} +?> + +

\ No newline at end of file diff --git a/upload.php b/upload.php new file mode 100644 index 0000000..9c078e3 --- /dev/null +++ b/upload.php @@ -0,0 +1,43 @@ + 500000) { + echo "Sorry, your file is too large."; + $uploadOk = 0; +} +// Allow certain file formats +if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg") { + echo "Sorry, only JPG, JPEG and PNG files are allowed."; + $uploadOk = 0; +} +// Check if $uploadOk is set to 0 by an error +if ($uploadOk == 0) { + echo "Sorry, your file was not uploaded."; +// if everything is ok, try to upload file +} else { + if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { + echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; + } else { + echo "Sorry, there was an error uploading your file."; + } +} +?> \ No newline at end of file