Quelques 337 marque-pages glanés pendant ma navigation sur le Web.
https://sqids.org/
https://blog.haschek.at/post/f2fda
À la manière des Zip Bomb, on peut mettre en place un GZip Bomb sur son serveur pour les scripts kiddies.
http://bookmarks.ecyseo.net/?rZSKHA
//specify the email address you are sending to, and the email subject
$email = 'email@example.com';
$subject = 'Email Subject';
//create a boundary for the email. This
$boundary = uniqid('np');
//headers - specify your from email address and name here
//and specify the boundary for the email
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: Your Name \r\n";
$headers .= "To: ".$email."\r\n";
$headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";
//here is the content body
$message = "This is a MIME encoded message.";
$message .= "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
//Plain text body
$message .= "Hello,\nThis is a text email, the text/plain version.
\n\nRegards,\nYour Name";
$message .= "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
//Html body
$message .= "
Hello,
This is a text email, the html version.
Regards,
Your Name";
$message .= "\r\n\r\n--" . $boundary . "--";
//invoke the PHP mail function
mail('', $subject, $message, $headers);
https://www.dadall.info/blog/index.php?article482/bonnes-pratiques-de-deploiement-php-en-2015
https://www.php.net/manual/en/function.gethostbynamel.php
Récupération de la liste d’adresses IP v4 à partir d’un nom de domaine.
Voir aussi :
• gethostbyname() - Get the IPv4 address corresponding to a given Internet host name
• gethostbyaddr() - Get the Internet host name corresponding to a given IP address
• checkdnsrr() - Check DNS records corresponding to a given Internet host name or IP address
• getmxrr() - Get MX records corresponding to a given Internet host name
http://www.ducea.com/2006/06/16/apache-tips-tricks-hide-php-version-x-powered-by/
Cacher la version de PHP dans les entêtes envoyés par Apache.
Dans le fichier php.ini :
expose_php = off
https://stackoverflow.com/questions/4065418/php-extremely-light-templating-system
/**
* Renders a single line. Looks for {{ var }}
*
* @param string $string
* @param array $parameters
*
* @return string
*/
function renderString($string, array $parameters)
{
$replacer = function ($match) use ($parameters)
{
return isset($parameters[$match[1]]) ? $parameters[$match[1]] : $match[0];
};
return preg_replace_callback('/{{\s*(.+?)\s*}}/', $replacer, $string);
}
https://michelf.ca/projets/php-markdown/syntaxe/
Documentation francisée sur la syntaxe Markdown (avec en plus une classe PHP pour générer du HTML à partir de Markdown <3).
http://aggemam.dk/code/dtmf
Générateur de bruit des boutons de téléphone écrit en PHP.