JavaScript

alert window JavaScript
alert("test");
Diaporama
Coolcarousels
Lightbox251

html

center
<div style='text-align:center;'>Hi</div>
DIV : position
<DIV style='position:absolute; top:95px; left:200px; width:600; height:300; color:#000000; background-color:#E5E3E3; z-index:1;'>
DIV : position css
#wrapper
{
position: relative; /* on positionne le conteneur */
margin: auto;
text-align: left;
/* For full screen changed only 2 parameters */
width: 100%; /* For full screen parameter 1 use 96% - otherwise use 100% -- 96% 1024px 980px 90% */
max-width:100%; /* For full screen parameter 2 use 100% - otherwise use 1024px -- 80% - 1280 - also determines the natural width of the site */
overflow: visible; /* scroll */
background-image: url(images/backimage.jpg);
background-repeat: repeat;
BACKGROUND-COLOR: white;
}
#content
{
position:relative;
z-index:1;
width: 100%;
padding: 0px 0px 0px;
BACKGROUND-COLOR: transparent;
}
#content_slide
{
position:relative;
margin: auto;
z-index:1;
width: 50%;
padding: 0px 0px 0px;
BACKGROUND-COLOR: transparent;
}
#content_slidewide
{
position:relative;
margin: auto;
z-index:1;
width: 100%;
padding: 0px 0px 0px;
BACKGROUND-COLOR: transparent;
border:1px solid red;
}

#col0_support_three
{
width: 1%;
float: left;
padding: 1%;
}
#col1_support_three
{
width: 30%;
float: left;
padding: 1%;
/* border:1px solid white; */
}
#col2_support_three
{
width: 30%;
float: left;
padding: 1%;
/* border:1px solid white; */
}
#col3_support_three
{
width: 30%;
float: left;
padding: 1%;
/* border:1px solid white; */
}

@media screen and (max-width: 768px)
{
#col1_support_three, #col2_support_three, #col3_support_three
{
float: left;
clear: left;
margin: 0;
padding: 0px 5px 0px 0px;
width: 97%;
height: 100%;
}

#col0_support_three
{
display:none;
}

}
/* End of Media Queries page size */

DIV : position html
<!-- ------------- ROW 1 : ----------------------------------- -->
<div id='col0_img_two'>
&nbsp;
</div> <!-- col0_img_two -->

<div id='col1_img_two'>
<div style='text-align:center;'>
<A class='imgpopuplink' HREF='photos/dez_mar_cor/mar_001.jpg' title=''><IMG class=''photos' SRC='photos/dez_mar_cor/mar_001.jpg'
style='max-width:270px; width:100%;' BORDER='0' ALT='' title=''></A>
</div> <!-- center -->
</div> <!-- col1_img_two -->

<div id='col2_img_two'>
<div style='text-align:center;'>
<A class='imgpopuplink' HREF='photos/dez_mar_cor/mar_002.jpg' title=''><IMG class='photos' SRC='photos/dez_mar_cor/mar_002.jpg'
style='max-width:270px; width:100%;' BORDER='0' ALT='' title=''></A>
</div> <!-- center -->
</div> <!-- col1_img_two -->

<div style='clear: both;'></div>

Font : réduire la taille html
<font size='-1'>Test</font>
hr
style="height:3px; border:none; color:black; background-color:black"
Include equivalent in javascript
<body>
<script src='inc_header.js'></script>
In inc_header.js:
document.write('<head>');
document.write('Hello World');
document.write('</head>');

Newsletter Webmail Orange
Stocker d'abord toutes les images sur un site web
Option 1
Créer un nouveau mail dans Webmail Orange
Choisir un theme
Copier coller le texte
Ajuster position & police
Copier coller les urls des images en html
Envoyer le mail à soi-même
Ouvrir le mail puis le transférer à soi-même pour voir la page finale formatée
Remarque: pas de fonctionalité table
Option 2
Creer la page en html avec Editplus
Garder une copie du mail en page html dans le site web de référence qui pourra ensuite être affiché si le mail ne s'affiche pas correctement
Créer un nouveau mail dans Webmail Orange
Copier coller la page html du mail
Envoyer le mail à soi-même
Ouvrir le mail puis le transférer à soi-même pour voir la page finale formatée
Modifier l'object du mail et son entête avant l'envoi
Remarques: vérifier qu'il n'y a pas de ligne wraps dans le code: ne s'affiche pas correctement dans webmail Orange
utiliser les balises br quand c'est approprié
Option 3
Utiliser un logiciel comme dans https://simple-mail.fr/ ou Sarbacane pour créer, gérer & envoyer les mails

p
<p style='font-size:120%; padding: 0 30px; background-color:white; border:1px; border-style:outset;'>
Style : exemple
style='text-align: left; color: #000000; background-color: #ffffff; border: 0; border-width:1px; border-style: none; border-color: #C9BCBC; font-family: Arial,Verdana,Helvetica; font-weight: normal; font-size: 100%; width: 100%; height: 105px;'
Tabulation
<style type='text/css'> .espace { margin-left:6em; } .espace2 { margin-top:9em; } .tabulation { text-indent: 20px; } ou .tabulation { margin-left: 20px; }

MySQL

select count
select count(*) as total from test;
Crypter un mot de passe
md5 ou sha1
md5($le_password)
Stocker le md5 dans un CHAR(32)
INSERT INTO clients(pseudo,password,telephone,adresse) VALUES("'.$pseudo.'","'.md5($password).'",...
SELECT id,pseudo, telephone, adresse FROM clients WHERE pseudo="'.$pseudo.'" AND password="'.md5($password).'"';

date_format
Exemple: 30/01/2015
select id, date_format(testdate , '%d/%m/%Y') as date from test;
Moteur de recherche
Supprimer tous les tags html de la page concernée
Stocker le resultat dans une table avec le nom/lien de la page
SQL Query le resultat et afficher le lien de la page correspondante
Traduction:
Stripped all the html tags of the relevant pages
Store the output into a table with the page name
Search the output and link to the relevant page

mysqldump
Local PC MySQL or MariaDB Database backup from a dedicated directory
Create back_db_local.bat with:
C:\wamp64\bin\php\php7.2.14\php back_db_local.php
pause
Create back_db_local.php with:
$const_strHost = "localhost";
$const_strUsername = "root";
$const_strPassword = "";
$const_strDbase = "mydb";
$strTable = "mytable";
$strFileExtension = ".sql";
print "Exporting table " . $strTable . "...\n";
system("C:\wamp64\bin\mysql\mysql5.7.24\bin\mysqldump --host=" . $const_strHost . " --user=" . $const_strUsername .
" --password=" . $const_strPassword . " -P3306 " . $const_strDbase .
" " . $strTable . " > " . $strTable . $strFileExtension);
/* do not forget switch -P3306 port for database */
print "The Mydb local backing up has ended!\n";

table gparticulier
select distinct gatype from gparticulier
CLIENT
PROSPECT
PERSONNEL

select distinct gptype from gparticulier
ECCA
POTENTIEL
LENVOL

select distinct formejuridique from gparticulier
PROFESSIONNEL
PARTICULIER
ASSOCIATION

php

Accent : afficher
Pour afficher les accents sous PHP 5.6
Remplacer
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
avec (à mettre tout en haut de la page)
header('Content-Type: text/html; charset=ISO-8859-1'); // écrase l'entête utf-8 envoyé par php
ini_set( 'default_charset', 'ISO-8859-1' );
Accent affichage en PHP
Pour afficher les accents correctement:
$DateTimeConvert = strtotime($dbRow->newsdate);
setlocale(LC_TIME, 'fr_FR');
$strDate = strftime("%A %d %B %Y %Hh%M", $DateTimeConvert);
Autres possibilités:
// setlocale(LC_TIME, 'fr_FR.UTF8');
// setlocale(LC_TIME, 'fr_CH.UTF-8');
// setlocale(LC_TIME, 'fra_fra');
// setlocale(LC_TIME, 'fr');

Code html : afficher
Pour afficher (en php) du code html sans l'executer : htmlspecialchars("html code ici");
Configurer le PHP sur Hébergement Web OVH
Comment choisir la version PHP ?
Déposer le fichier .ovhconfig à la racine de l'espace disque, via FTP.
Pour utiliser PHP 5.5 par exemple, le fichier .ovhconfig contiendra :

app.engine=php
app.engine.version=5.5
http.firewall=none
environment=production


5.4 est la version par défaut
Attention, une fois le .ovhconfig en place, la version PHP utilisée est celle définie par app.engine.version
Les directives de votre .htaccess comme SetEnv PHP_VER ... sont alors ignorées

Voici la liste des changements incompatibles entre les versions de PHP :
> de PHP 4 à PHP 5 : http://www.php.net/manual/fr/migration5.incompatible.php
> de PHP 5.1 à PHP 5.2 : http://www.php.net/manual/fr/migration52.incompatible.php
> de PHP 5.2 à PHP 5.3 : http://www.php.net/manual/fr/migration53.incompatible.php
> de PHP 5.3 à PHP 5.4 : http://www.php.net/manual/fr/migration54.incompatible.php
> de PHP 5.4 à PHP 5.5 : http://www.php.net/manual/fr/migration55.incompatible.php
> de PHP 5.5 à PHP 5.6 : http://www.php.net/manual/fr/migration56.incompatible.php

Par ailleurs, l'utilisation d'une version PHP à jour permettra de profiter pleinement des dernières innovations, comme l'optimisation PHP-FPM :
https://www.ovh.com/fr/g1175.php-fpm

Attention : à partir de PHP-FPM, et pour des raisons de sécurité, les options suivantes sont désactivées (dépréciées par PHP) :
register_globals
magic_quotes_gpc

Pour désactiver PHP-FPM ?
Il suffit de mettre dans le fichier .ovhconfig:
app.engine=phpcgi
app.engine.version=AUTO
Editeur de Mail : outil
Outil editeur de mail en php: tinymce
Erreurs: Deprecated
Pour cacher les errors Deprecated
modifier php.ini:
; error_reporting = E_ALL
; no errors at all
; error_reporting = 0
; all except deprecated & strict
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Can also be set in php voir:
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);

Deprecated: mysql_connect()
The mysql extension is deprecated and will be removed in the future
Use mysqli or PDO instead in phpconnect.php
Solution: add @ at mysql_connect()
$dbconnection = @mysql_connect($const_strHost, $const_strUsername, $const_strPassword);

Forcer la mise à jour d'une image
SRC=image.png?time= . time()
Hashage du mot de passe
Hashage du mot de passe
$md5 = md5('letmein');
ou Secure Hash Algorithm (better)
$sha1 = sha1('letmein');
Il suffit d'appliquer le sha1 au mot de passe que l'utilisateur donne, puis de le
comparer au sha1 stocké dans la base de données.

tags php
<?php code... ?>
TinyMCE v4.1.9
Pour utiliser background-color
<div style='background-color: #ffffcc;'>
</div>

 

Share
Mail  Facebook  Messenger  Twitter   Pinterest   LinkedIN