This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html > | |
<head> | |
<meta charset="UTF-8"> | |
<title>External URLs</title> | |
</head> | |
<body> | |
<ion-view title="Test Page"> | |
<ion-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img id="blah" src="#" alt="Image du blog" style="width: 30%;" /> | |
<input type="file" id="imgInp" name="img" required="required" class="form-control col-md-9 col-xs-12" required="" /> | |
<script | |
src="https://code.jquery.com/jquery-2.2.4.min.js" | |
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" | |
crossorigin="anonymous"></script> | |
<script> | |
function readURL(input,cible) { | |
if (input.files && input.files[0]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.css" rel="stylesheet"> | |
<div class="summernote"></div> | |
<textarea name="summerNoteContent" id="resultSummerNote" required=""></textarea> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.js"></script> | |
<script | |
src="https://code.jquery.com/jquery-2.2.4.min.js" | |
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" | |
crossorigin="anonymous"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$file=''; | |
if(isset($_FILES['img']) AND $_FILES["img"]['size']<=10000000 AND $_FILES["img"]['size']>100){ | |
$folder = '../images/blog/'; | |
$tmp_name = $_FILES["img"]["tmp_name"]; | |
$name = $_FILES["img"]["name"]; | |
$img = pathinfo($_FILES["img"]['name']); | |
$file = "blog_".rand(0,999999).$name; | |
move_uploaded_file($tmp_name, $folder.$file); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$stmt = $BD->query("SELECT LAST_INSERT_ID()"); | |
$lastId = $stmt->fetch(PDO::FETCH_NUM); | |
$lastId = $lastId[0]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$valid_formats = array("jpg", "png", "gif", "bmp"); | |
$max_file_size = 1024*7500; //100 kb | |
$path = "assets/img/photo/"; // Upload directory | |
$count = 0; | |
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){ | |
foreach ($_FILES['files']['name'] as $f => $name) { | |
if ($_FILES['files']['error'][$f] == 4) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Configure your keys (secret, piblic): https://www.google.com/recaptcha | |
$siteKey = 'XXXXXXXXXXXXXXXXXXXXXX'; // votre clé publique | |
?> | |
<form action="submit.php"> | |
.... | |
<div class="g-recaptcha" id="Optional-id"></div> | |
</form> | |
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script> | |
<script type="text/javascript" charset="utf-8"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(strpos($_SERVER['REQUEST_URI'],"home")){ // For example blabla.com/home | |
// Do something | |
}?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using the core $.ajax() method | |
$.ajax({ | |
// The URL for the request | |
url: "post.php", | |
// The data to send (will be converted to a query string) | |
data: { | |
id: 123 | |
}, | |
// Whether this is a POST or GET request | |
type: "GET", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - | |
cat >/etc/apt/sources.list.d/webupd8team-java.list<< EOF | |
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main | |
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main | |
EOF | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 | |
apt-get update | |
apt-get install oracle-java8-installer | |
java -version |
OlderNewer