Skip to content

Instantly share code, notes, and snippets.

@Orianne0605
Orianne0605 / index.php
Created October 9, 2019 13:18
HTML les bonnes pratiques
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author", content="orianne">
<meta name="description" content="Find the Previous est un site commandé par Sauron">
<title>Find the precious!</title>
<link rel="stylesheet" href="style.css">
@Orianne0605
Orianne0605 / index.html
Last active October 9, 2019 13:22
HTML les bonnes pratiques
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author", content="orianne">
<meta name="description" content="Find the Previous est un site commandé par Sauron">
<title>Find the precious!</title>
<link rel="stylesheet" href="style.css">
@Orianne0605
Orianne0605 / Wizarding schools
Created October 7, 2019 10:12
Manipulation de données
mysql> INSERT INTO school (name, country, capacity)
-> VALUES ('Beauxbatons Academy of Magic', 'France', 550),
-> ('Castelobruxo', 'Brazil', 380),
-> ('Durmstrang Institute', 'Norway', 570),
-> ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450),
-> ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300),
-> ('Koldovstoretz', 'Russia', 125),
-> ('Mahoutokoro School of Magic', 'Japan', 800),
-> ('Uagadou School of Magic', 'Uganda', 350);
Query OK, 8 rows affected (0.05 sec)
@Orianne0605
Orianne0605 / form.php
Created October 4, 2019 17:18
Formulaire
<?php
$errors = [
"errorUserName" => "",
"errorUserForname" => "",
"errorEmail" => "",
"errorPhone" => "",
"errorSubject" => "",
"errorMessage" => "",
@Orianne0605
Orianne0605 / Récupération des sorciers
Created October 1, 2019 13:52
récupérer des infos avec SELECT
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |
| 7 | george | weasley | 1978-04-01 | |
@Orianne0605
Orianne0605 / index.php
Created September 28, 2019 22:51
Debug toi même en PHP
<?php
$characters = [
"Negan" => [
"city" => "The Sanctuary",
"weapon" => "Lucille"
],
"Daryl" => [
"city" => "Alexandria",
"weapon" => "crossbow"
],
<?php
function writeSecretSentence ($parametre1, $parametre2){
return "$parametre1 s'incline face à $parametre2";
}
echo writeSecretSentence('Le chien', 'la lune ');
echo writeSecretSentence('Le chat', 'la lumière ');
echo writeSecretSentence('La salamandre', 'l\'assiette ');
echo writeSecretSentence('Le tigre', 'la bouteille ');
@Orianne0605
Orianne0605 / Poings, fouet, pistolet
Created September 26, 2019 14:50
Les conditions en PHP
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)];// Cela permet de choisir une arme de manière aléatoire.
echo "The opponent weapon is $opponentWeapon, " ;
if ($opponentWeapon == 'fists') {
$indyWeapon = 'gun';
}
elseif ($opponentWeapon =='gun') {
$indyWeapon = 'whip';
@Orianne0605
Orianne0605 / Create the Indiana filmography
Created September 25, 2019 14:04
Les tableaux et boucles PHP
<?php
$movie = [
'Indiana Jones and the Kingdom of the Crystal Skull,' => ['Harrison Ford,', 'Karen Allen,', 'Cate Blanchett.'],
'Jones and the Temple of Doom,' => ['Harrison Ford,', 'Kate Capshaw,', 'Jonathan Ke Quan.'],
'Raiders of the Lost Ark,' => ['Harrison Ford,', 'Paul Freeman,','Karen Allen.']
];
foreach ($movie as $movie2[0] => $actor) {
echo 'Dans le film ' . $movie2[0] . ' les principaux acteurs sont ', implode(' ', $actor), "<br>";
@Orianne0605
Orianne0605 / index.php
Created September 24, 2019 13:52
Chaînes de caractères PHP
<?php
$message1 = '0@sn9sirppa@#?ia\'jgtvryko1';
$message2 = 'q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj';
$message3= 'aopi?sgnirts@#?sedhtg+p9l!';
$cle1 = strlen($message1) /2;
$cle2 = strlen($message2) /2;
$cle3 = strlen($message3) /2;