<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2472914414356920088</id><updated>2024-09-28T01:35:37.170+01:00</updated><category term="Scripts"/><category term="Astuces"/><category term="Généralités"/><category term="Systèmes complets"/><title type='text'>Formation Php</title><subtitle type='html'>Des cours, des tutoriels de qualité, et les scripts php gratuits, les plus populaires</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Octavarium</name><uri>http://www.blogger.com/profile/08704305299386124432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-2980183411497976907</id><published>2007-09-11T20:53:00.000+00:00</published><updated>2007-09-14T10:52:34.994+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scripts"/><title type='text'>Convertir un nombre de secondes en jours, heures, minutes et secondes</title><content type='html'>Comme le titre le montre, dans ce tuto on va essayer de convertir un nombre de secondes en jours, heures, minutes et secondes.&lt;br /&gt;Par exemple : On a une variable qui définit une durée de 38600 secondes, mais comme vous remarquez, cette durée aurait été plus claire et plus facile à retenir si elle était présentée en valeurs jours, heures, minutes et secondes , c&#39;est à dire sous forme d&#39;une date.&lt;br /&gt;L&#39;idée de ce tuto est d&#39;apprendre à créer une fonction qui permettra de convertir le nombre de secondes en forme d&#39;une date.&lt;br /&gt;&lt;br /&gt;Alors au travail! :)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;function transforme($time)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;if ($time&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;=86400)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;/* 86400 = 3600*24 c&#39;est à dire le nombre de secondes dans un seul jour ! donc là on vérifie si le nombre de secondes donné contient des jours ou pas */&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// Si c&#39;est le cas on commence nos calculs en incluant les jours&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// on divise le nombre de seconde par 86400 (=3600*24)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// puis on utilise la fonction floor() pour arrondir au plus petit&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$jour = floor($time/86400); &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// On extrait le nombre de jours&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$reste = $time%86400;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$heure = floor($reste/3600); &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// puis le nombre d&#39;heures&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$reste = $reste%3600;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$minute = floor($reste/60); &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;&lt;br /&gt;// puis les minutes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$seconde = $reste%60; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// et le reste en secondes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// on rassemble les résultats en forme de date&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$result = $jour.&#39;j &#39;.$heure.&#39;h &#39;.$minute.&#39;min &#39;.$seconde.&#39;s&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;elseif ($time&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt; &amp;lt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;86400 AND $time&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;=3600)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// si le nombre de secondes ne contient pas de jours mais contient des heures&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// on refait la même opération sans calculer les jours&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$heure = floor($time/3600);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$reste = $time%3600;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$minute = floor($reste/60);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$seconde = $reste%60;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$result = $heure.&#39;h &#39;.$minute.&#39;min &#39;.$seconde.&#39; s&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;elseif ($time&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;3600 AND $time&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;=60)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// si le nombre de secondes ne contient pas d&#39;heures mais contient des minutes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$minute = floor($time/60);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$seconde = $time%60;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$result = $minute.&#39;min &#39;.$seconde.&#39;s&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;elseif ($time &amp;lt; 60)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// si le nombre de secondes ne contient aucune minutes&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$result = $time.&#39;s&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;return $result;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;a href=&quot;http://formation-php.prohosts.org/demos/transforme.php&quot; target=&quot;popup&quot; onclick=&quot;window.open(&#39;&#39;,&#39;popup&#39;,&#39;width=300,height=400,left=0,top=0,scrollbars=1&#39;)&quot;&gt;&lt;b&gt;Tester le script&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;wala c tout :)&lt;br /&gt;@+&lt;br /&gt;&lt;br /&gt;PHPaul</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/2980183411497976907/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/2980183411497976907' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/2980183411497976907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/2980183411497976907'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/09/convertir-un-nombre-de-secondes-en.html' title='Convertir un nombre de secondes en jours, heures, minutes et secondes'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-4911989188827998671</id><published>2007-09-10T10:10:00.000+00:00</published><updated>2007-09-10T20:17:12.253+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scripts"/><title type='text'>Extraire les métas tags d&#39;une page HTML</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://img490.imageshack.us/img490/4803/howtocreatemetatagsjv3.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 128px; height: 167px;&quot; src=&quot;http://img490.imageshack.us/img490/4803/howtocreatemetatagsjv3.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Les &quot;meta tags&quot; font partie du code de vos pages. La plupart de ces balises sont inutiles pour le référencement, mais certaines d&#39;entre elles sont quasi indispensables.&lt;br /&gt;&lt;br /&gt;Dans ce tutoriel, on va essayer d&#39;apprendre comment lire les metas tags (ou les balises métas) d&#39;une page HTML.&lt;br /&gt;&lt;br /&gt;Pour ceci, je vais vous présenter la fonction php qui nous sera utile.&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;get_meta_tags ( ) : &lt;/span&gt;&lt;/span&gt;cette fonction permet de récupérer les entêtes HTML (entre  &amp;lt;head&amp;gt; et &amp;lt;/head&amp;gt;) d&#39;une page web.&lt;br /&gt;Ceci pourrait être utilisé dans la cadre d&#39;un annuaire par exemple, ou pour connaitre la langue d&#39;un site sans y aller dessus ... bref, plein d&#39;applications sont possibles à l&#39;aide de cette fonction .&lt;br /&gt;&lt;br /&gt;Je vous dans notre exemple le script qui permettra d&#39;éxtraire les métas tags de nos pages :&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;font-size:85%;&quot;  &gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// On définit l&#39;adresse de la page à opèrer dans la variable &#39;$page&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// cette valeur pourra provenir d&#39;un formulaire par exemple&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$page = &#39;http://www.site.com&#39;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//on vérifie la disponibilité de notre page&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//le @ devant la fonction get_meta_tags permet de ne pas retourner d&#39;erreur si la réponse est false&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;if(!$meta=@get_meta_tags($page)){&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;echo &#39;Le lien que vous avez fournis est indisponible.&#39;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}else{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//si aucune erreur n&#39;est détecter, on peut extraire les informations meta&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;  //une liste non exaustive : description, keywords, revisit-after, location, content-language, etc...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;  //la variable retourne sous forme de tableau chacun des ses informations.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;  //exemple : &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$description=$meta[&#39;description&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$keywords=$meta[&#39;keywords&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$revisit=$meta[&#39;revisit-after&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$locatio=$meta[&#39;location&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;$language=$meta[&#39;content-language&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt; /* etc ... */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Voilà, c&#39;est tout pour ce tutoriel.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Bon apprentissage!&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;@ bientôt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;PHPaul&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/4911989188827998671/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/4911989188827998671' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/4911989188827998671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/4911989188827998671'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/09/extraire-les-mtas-tags-dune-page-html.html' title='Extraire les métas tags d&#39;une page HTML'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-52948596885064883</id><published>2007-09-09T20:51:00.000+00:00</published><updated>2007-09-09T21:40:26.074+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Astuces"/><title type='text'>Comment savoir si vos partenaires ont gardé vos liens sur leur site?</title><content type='html'>&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 187px; height: 213px;&quot; src=&quot;http://www.skyr.lu/images/partenaires.gif&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;Faire un site c’est aussi le diffuser sur Internet. Un des meilleurs moyen reconnu est le partage de liens plus communément appelé, « échange de liens ». Le site &lt;strong&gt;A&lt;/strong&gt; fait un lien qui pointe sur le site &lt;strong&gt;B&lt;/strong&gt; qui lui-même fait un lien qui pointe sur le site &lt;strong&gt;A&lt;/strong&gt;. Cela a pour apport de lier les sites entrent eux et d’augmenter le Rank (positionnement) des sites.&lt;br /&gt;&lt;br /&gt;L’échange de liens est laborieux à construire; il faut contacter les webmasters d’autres sites, trouver les bonnes pages à croiser, modifier les sources des pages et maintenir l’échange sur le temps. C’est sur cette dernière partie que nous allons travailler.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Comment savoir si le webmaster n’a pas enlevé votre lien sur son site ??&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1° La première étape consiste à connaître la page sur laquelle votre lien est placé. Cette page doit tout le temps être disponible car nous allons aller la chercher et l’aspirer pour pouvoir l’analyser.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2  style=&quot;font-weight: normal;font-family:courier new;&quot; id=&quot;code_source&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span class=&quot;petit&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&lt;/span&gt;&lt;blockquote  style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;&amp;lt;?php&lt;br /&gt;$page_source &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;= &lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);font-size:78%;&quot; &gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$fp&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;=@&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;fopen&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$page_source&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);font-size:78%;&quot; &gt;&quot;r&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;);&lt;br /&gt;if(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$fp&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;)  {&lt;br /&gt;while(!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;feof&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$fp&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;))  {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$chaine &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;.= &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;fgets&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$fp&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;1024&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;?&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;La page où se trouve le lien sera au format http://www.lesite.com/la_page_ou_se_trouve_ton_lien&lt;br /&gt;Nous allons dans un premier temps aspirer la page et placer tout simplement son contenu dans une variable.&lt;br /&gt;&lt;br /&gt;2° La seconde étape consiste à regarder si le lien se trouve dans la page aspirée du site. J’ai vu sur Internet des scripts qui faisaient plus de 200 lignes pour faire cette analyse. PHP possède une fonction performante qui repère toute les occurrences correspondant à un masque donné : &lt;strong&gt;preg_match_all&lt;/strong&gt;. Toutes les chaînes correspondant au masque sont capturées et sont écrites dans un tableau.&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2  style=&quot;font-weight: normal;font-family:courier new;&quot; id=&quot;code_source&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span class=&quot;petit&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;blockquote  style=&quot;font-family:courier new;&quot;&gt;&lt;h2  style=&quot;font-weight: normal;font-family:courier new;&quot; id=&quot;code_source&quot;&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;span class=&quot;petit&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$masque &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);&quot;&gt;&#39;#href=&quot;(.*?)&quot;#i&#39;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;preg_match_all&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);&quot;&gt; &quot;$masque&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;$chaine&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt; $out&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt; PREG_SET_ORDER &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Le résultat se trouve dans le tableau $out&lt;br /&gt;&lt;br /&gt;3° Troisième et dernière étape avec le test de vérification: regarder si le lien se trouve dans le tableau. Dans le script j’ai tenu à vérifier également combien de fois le lien se trouvait sur la page.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2  style=&quot;font-weight: normal;font-family:courier new;&quot; id=&quot;code_source&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span class=&quot;petit&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&lt;/span&gt;&lt;blockquote  style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$lien_a_verifier &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;= &lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);font-size:78%;&quot; &gt;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$i&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;=-&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$compte&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;;&lt;br /&gt;while (&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$i &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;&lt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;count&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$out&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;))&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$i&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;++;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(240, 112, 0);font-size:78%;&quot; &gt;// affiche tous les elements du tableau&lt;br /&gt;// vous pouvez decocher la ligne ci dessus pour avoir tous les elements du tableau&lt;br /&gt;// echo $out[$i][1];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;if(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$out&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;[&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$i&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;][&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;] == &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$lien_a_verifier&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;) &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$compte&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;++;&lt;br /&gt;}&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$compte &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;0 &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;)  echo &lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);font-size:78%;&quot; &gt;&#39;Le lien existe &#39;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;$compte&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);font-size:78%;&quot; &gt;&#39; fois&#39;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);font-size:78%;&quot; &gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);font-size:78%;&quot; &gt;?&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Le lien à vérifier doit correspondre à celui que vous avez donné à votre partenaire. Si vous désirez développer plus en profondeur ce noyau, vous devrez aussi &lt;strong&gt;vérifier tout type de lien&lt;/strong&gt;. Car un webmaster peut écrire 1 lien avec des doubles quotes ou sans.&lt;br /&gt;&lt;br /&gt;Ce bout de source montre comment il peut être facile en php avec quelques lignes de code de remonter une page Internet et d’en faire son analyse. Il est aussi d’une utilité évidente. Avoir des échanges de liens, c’est avant tout pourvoir les conserver sur le temps et ce script devrait vous y aider.&lt;br /&gt;&lt;br /&gt;Source : http://www.phpsources.org/</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/52948596885064883/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/52948596885064883' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/52948596885064883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/52948596885064883'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/09/comment-savoir-si-vos-partenaires-ont.html' title='Comment savoir si vos partenaires ont gardé vos liens sur leur site?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-1124498684018111581</id><published>2007-09-08T12:12:00.000+00:00</published><updated>2007-09-08T22:02:37.592+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Systèmes complets"/><title type='text'>Upload d&#39;image vers un serveur</title><content type='html'>&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/LHS2theTd6k&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/LHS2theTd6k&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;Salut,&lt;br /&gt;Aujourd&#39;hui, dans cet article je vais essayer de vous présenter un système d&#39;upload d&#39;image vers un serveur tout en passant par le &lt;span style=&quot;font-weight: bold;&quot;&gt;PHP&lt;/span&gt;.&lt;br /&gt;Ce système ne comporte qu&#39;un seul fichier &lt;span style=&quot;font-style: italic;&quot;&gt;&quot;upload.php&quot; .&lt;/span&gt;&lt;br /&gt;Ce fichier sera composé de :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Formulaire pour selectionner l&#39;image à uploader&lt;/li&gt;&lt;li&gt;Script pour contrôler l&#39;image (taille, extension, dimensions, nom du fichier ...) et l&#39;uploader&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;On commence par le formulaire :&lt;/span&gt;&lt;br /&gt;&lt;blockquote  style=&quot;color: rgb(204, 102, 0);font-family:courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;form enctype=&quot;multipart/form-data&quot; action=&quot;upload.php&quot; method=&quot;POST&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input type=&quot;hidden&quot; name=&quot;posted&quot; value=&quot;1&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-size:85%;&quot; &gt;//pour permettre de vérifier qu&#39;une requête vient d&#39;être transmise par le formulaire&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input name=&quot;fichier&quot; type=&quot;file&quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Uploader&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 204, 0);&quot;&gt;==&gt; Aperçu :&lt;/span&gt;&lt;br /&gt;&lt;img src=&quot;http://img401.imageshack.us/img401/6006/codegb0.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Puis on passe au script PHP qui va contrôler l&#39;image et l&#39;uploader après :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote  style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot;&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//  DEFINITION DES VARIABLES &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$target     = &#39;fichiers/&#39;;  &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// Repertoire cible&lt;/span&gt;&lt;br /&gt;$extension  = &#39;gif&#39;;   &lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 1 permise du fichier sans le .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;$extension2  = &#39;png&#39;;  &lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 2 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;permise &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;du fichier sans le .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;$extension3  = &#39;jpg&#39;;  &lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 3 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;permise &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;du fichier sans le .&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$max_size   = 250000;     &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Taille max en octets du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$width_max  = 1024;       &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt; // Largeur max de l&#39;image en pixels&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$height_max = 768;        &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Hauteur max de l&#39;image en pixels&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//  DEFINITION DES VARIABLES LIEES AU FICHIER&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$time       = time();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$nom_file   = $_FILES[&#39;fichier&#39;][&#39;name&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$tmp        = $_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//  SCRIPT D&#39;UPLOAD&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;if(!empty($_POST[&#39;posted&#39;]))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie si le champ est rempli&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;   if(!empty($_FILES[&#39;fichier&#39;][&#39;name&#39;]))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;       {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie l&#39;extension du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 51, 153); font-weight: bold;font-family:courier new;&quot; &gt;       if(substr($nom_file, -3) == $extension OR substr($nom_file, -3) == $extension2 OR substr($nom_file, -3) == $extension3)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 51, 153); font-weight: bold;font-family:courier new;&quot; &gt;           {&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On récupère les dimensions du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;          $infos_img = getimagesize($_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie les dimensions et taille de l&#39;image&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;           if(($infos_img[0] &lt;= $width_max) &amp;&amp;amp; ($infos_img[1] &lt;= $height_max) &amp;&amp;amp; ($_FILES[&#39;fichier&#39;][&#39;size&#39;] &lt;= $max_size))                 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;{                                &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;br /&gt;// Si c&#39;est OK, on teste l&#39;upload                 &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;               if (move_uploaded_file ($_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;] , $target.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;] ) )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;                   {&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt; // Si upload OK alors on affiche le message de réussite&lt;/span&gt;&lt;span style=&quot;font-style: italic;font-family:courier new;&quot; &gt;                     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Image uploadée avec succès !&amp;lt;/b&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;hr /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Fichier :&amp;lt;/b&amp;gt; &#39;,$time,&#39;_&#39;,$_FILES[&#39;fichier&#39;][&#39;name&#39;], &#39;&amp;lt;br /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Taille :&amp;lt;/b&amp;gt; &#39;, $_FILES[&#39;fichier&#39;][&#39;size&#39;], &#39; Octets&amp;lt;br /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Largeur :&amp;lt;/b&amp;gt; &#39;, $infos_img[0], &#39; px&amp;lt;br /&amp;gt;&#39;;                     echo &#39;&amp;lt;b&amp;gt;Hauteur :&amp;lt;/b&amp;gt; &#39;, $infos_img[1], &#39; px&amp;lt;br /&amp;gt;&#39;;      echo &#39;&amp;lt;b&amp;gt;URL :&amp;lt;/b&amp;gt; &amp;lt;input type=&quot;text&quot; value=&quot;http://www.monsite.com/fichiers/&#39;.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;].&#39;&quot; size=38&amp;gt;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;hr /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;img src=&quot;http://www.monsite.com/fichiers/&#39;.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;].&#39;&quot; /&amp;gt;&amp;lt;br /&amp;gt;&#39;;               &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;{                    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur système                     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Problème lors de l\&#39;upload !&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;b&amp;gt;&#39;, $_FILES[&#39;fichier&#39;][&#39;error&#39;], &#39;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour les dimensions et taille de l&#39;image&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;                 echo &#39;&amp;lt;b&amp;gt;Veuillez saisir une image d\&#39;une taille inférieur à 1024*768&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;;           &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 153, 0);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;       &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;{            &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour l&#39;extension             &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Votre image ne comporte pas l\&#39;extension .gif , .png ou .jpg!&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;;       &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;}    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;{        &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour le champ vide         &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Le champ du formulaire est vide !&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Maintenant un bilan qui présente le contenu du fichier &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;upload.php&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote  style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot;&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//------------------------------------&lt;br /&gt;// Script réalisé par Samir.Paul.Ouahhabi&lt;br /&gt;// Le 08/9/2007&lt;br /&gt;// Licence GNU/GPL&lt;br /&gt;// http://formation-php.blogspot.com/&lt;br /&gt;// ideetek@gmail.com&lt;br /&gt;//-------------------------------------&lt;br /&gt;&lt;br /&gt;//----------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//  DEFINITION DES VARIABLES &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;//----------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$target     = &#39;fichiers/&#39;;  &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;// Repertoire cible&lt;/span&gt;&lt;br /&gt;$extension  = &#39;gif&#39;;   &lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 1 permise du fichier sans le .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;$extension2  = &#39;png&#39;;  &lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 2 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;permise &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;du fichier sans le .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;$extension3  = &#39;jpg&#39;;  &lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;// Extension 3 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;permise &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;du fichier sans le .&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$max_size   = 250000;     &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Taille max en octets du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$width_max  = 1024;       &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt; // Largeur max de l&#39;image en pixels&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$height_max = 768;        &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Hauteur max de l&#39;image en pixels&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//  DEFINITION DES VARIABLES LIEES AU FICHIER&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;//---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$time       = time();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$nom_file   = $_FILES[&#39;fichier&#39;][&#39;name&#39;];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;$tmp        = $_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// FORMULAIRE D&#39;UPLOAD&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot; &gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;form enctype=&quot;multipart/form-data&quot; action=&quot;upload.php&quot; method=&quot;POST&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input type=&quot;hidden&quot; name=&quot;posted&quot; value=&quot;1&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;font-size:85%;&quot;  &gt;//pour permettre de vérifier qu&#39;une requête vient d&#39;être transmise par le formulaire&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input name=&quot;fichier&quot; type=&quot;file&quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Uploader&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot; &gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-family:courier new;&quot; &gt;&amp;lt;?php&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;br /&gt;&lt;br /&gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//  SCRIPT D&#39;UPLOAD&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;if(!empty($_POST[&#39;posted&#39;]))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie si le champ est rempli&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;   if(!empty($_FILES[&#39;fichier&#39;][&#39;name&#39;]))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;       {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie l&#39;extension du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 51, 153); font-weight: bold;font-family:courier new;&quot; &gt;       if(substr($nom_file, -3) == $extension OR substr($nom_file, -3) == $extension2 OR substr($nom_file, -3) == $extension3)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 51, 153); font-weight: bold;font-family:courier new;&quot; &gt;           {&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On récupère les dimensions du fichier&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;          $infos_img = getimagesize($_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// On vérifie les dimensions et taille de l&#39;image&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt; if(($infos_img[0] &lt;= $width_max) &amp;&amp;amp; ($infos_img[1] &lt;= $height_max) &amp;&amp;amp; ($_FILES[&#39;fichier&#39;][&#39;size&#39;] &lt;= $max_size)) &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;{                                &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;&lt;br /&gt;// Si c&#39;est OK, on teste l&#39;upload                 &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;               if (move_uploaded_file ($_FILES[&#39;fichier&#39;][&#39;tmp_name&#39;] , $target.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;] ) )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;                   {&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt; // Si upload OK alors on affiche le message de réussite&lt;/span&gt;&lt;span style=&quot;font-style: italic;font-family:courier new;&quot; &gt;                     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Image uploadée avec succès !&amp;lt;/b&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;hr /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Fichier :&amp;lt;/b&amp;gt; &#39;,$time,&#39;_&#39;,$_FILES[&#39;fichier&#39;][&#39;name&#39;], &#39;&amp;lt;br /&amp;gt;&#39;; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Taille :&amp;lt;/b&amp;gt; &#39;, $_FILES[&#39;fichier&#39;][&#39;size&#39;], &#39; Octets&amp;lt;br /&amp;gt;&#39;; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Largeur :&amp;lt;/b&amp;gt; &#39;, $infos_img[0], &#39; px&amp;lt;br /&amp;gt;&#39;; echo &#39;&amp;lt;b&amp;gt;Hauteur :&amp;lt;/b&amp;gt; &#39;, $infos_img[1], &#39; px&amp;lt;br /&amp;gt;&#39;; echo &#39;&amp;lt;b&amp;gt;URL :&amp;lt;/b&amp;gt; &amp;lt;input type=&quot;text&quot; value=&quot;http://www.monsite.com/fichiers/&#39;.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;].&#39;&quot; size=38&amp;gt;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;hr /&amp;gt;&#39;;                   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;img src=&quot;http://www.monsite.com/fichiers/&#39;.$time.&#39;_&#39;.$_FILES[&#39;fichier&#39;][&#39;name&#39;].&#39;&quot; /&amp;gt;&amp;lt;br /&amp;gt;&#39;; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255); font-weight: bold;font-family:courier new;&quot; &gt;{                    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur système                     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Problème lors de l\&#39;upload !&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;b&amp;gt;&#39;, $_FILES[&#39;fichier&#39;][&#39;error&#39;], &#39;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 0); font-weight: bold;font-family:courier new;&quot; &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour les dimensions et taille de l&#39;image&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt; echo &#39;&amp;lt;b&amp;gt;Veuillez saisir une image d\&#39;une taille inférieur à 1024*768&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 153, 0);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;       &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;{            &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour l&#39;extension             &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Votre image ne comporte pas l\&#39;extension .gif , .png ou .jpg!&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(153, 51, 153);font-family:courier new;&quot; &gt;}    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;{        &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;font-family:courier new;&quot; &gt;// Sinon on affiche une erreur pour le champ vide         &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;echo &#39;&amp;lt;b&amp;gt;Le champ du formulaire est vide !&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#39;;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);font-family:courier new;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Bon, c&#39;était tout pour cet article =)&lt;br /&gt;Vous pouvez élaborer ce scripts en ajoutant un design et un compteur ...&lt;br /&gt;D&#39;ailleurs c&#39;est ce que j&#39;ai fait ici : &lt;a href=&quot;http://server001.freehostia.com/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);font-size:130%;&quot; &gt;DEMO&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy it&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;PHPaul&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/1124498684018111581/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/1124498684018111581' title='6 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/1124498684018111581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/1124498684018111581'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/09/upload-dimage-vers-un-serveur_08.html' title='Upload d&#39;image vers un serveur'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-8417951606877427690</id><published>2007-09-07T11:19:00.000+00:00</published><updated>2007-09-08T15:37:10.926+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scripts"/><title type='text'>Fonction de vérification d&#39;Email</title><content type='html'>Bonjour !&lt;br /&gt;Dans cette article je vais vous montrer une manière facile pour verifier une adresse Email tout en utilisant les RegEx PHP .&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Maintenant vous vous demandez sûrement : Qu&#39;est-ce Qu&#39;un RegEx ?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;Je vais essayer de vous donner une petite définition :&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;RegEx&lt;/span&gt; : &lt;span style=&quot;font-style: italic;&quot;&gt;abréviation de l&#39;expression Anglaise &lt;span style=&quot;font-weight: bold;&quot;&gt;Regular Expression&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Les expressions régulières, généralement connues sous le nom de &quot;RegEx&quot; sont un ensemble de combinaisons principales qui sont censées pour permettre d&#39;avoir une grande variété de contrôle de ce qu&#39;on recherche dans une chaine de caractère. RegEx est employé beaucoup sous Unix, et est commun entre beaucoup de programmes.&lt;br /&gt;&lt;br /&gt;Donc plus clairement, les RegEx vont nous permettre d&#39;analyser une adresse Email donnée pour vérifier si elle convient à la forme connue des adresses emails (&lt;span style=&quot;font-style: italic;&quot;&gt;ex : personne@site.com&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;Passons maintenant au travail.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;function email_OK ($email)  &lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;// On dénonce le nom de la fonction&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;{&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;   $Syntaxe = &#39;#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#&#39; ;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0); font-family: courier new;font-size:85%;&quot; &gt;//On donne la forme RegEx que doit avoir l&#39;Email&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;   if(preg_match($Syntaxe,$email))&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0); font-family: courier new;font-size:85%;&quot; &gt;// Et maintenant on compare le syntaxede l&#39;Email donné &#39;$email&#39; avec la variable &#39;$Syntaxe&#39;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;    {&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;      return true;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic; font-family: courier new;font-size:85%;&quot; &gt;// si l&#39;email convient est valide ça retourne une réponse positive&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;     }&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;   else&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;     return false;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:85%;&quot; &gt;&lt;span style=&quot;font-family: courier new;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(204, 153, 51); font-family: courier new;font-size:85%;&quot; &gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;// sinon ça retourne une réponse négative&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new; color: rgb(204, 153, 51);font-size:85%;&quot; &gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Maintenant avec cette fonction vous pouvez vérifier la validité d&#39;un Email facilement tout en faisant :&lt;br /&gt;&lt;br /&gt;&lt;blockquote style=&quot;font-family: courier new; color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;if (email_OK($email))&lt;br /&gt;{&lt;br /&gt;echo &#39; Cette adresse Email est valide &#39; ;&lt;br /&gt;}&lt;br /&gt;elseif (!email_OK($email))&lt;br /&gt;{&lt;br /&gt;echo &#39; Cette adresse Email est invalide &#39; ;&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;Voilà c&#39;est tout :)&lt;br /&gt;J&#39;espère que ce petit tuto vous sera utile&lt;br /&gt;au revoir :)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;PHPaul&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/8417951606877427690/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/8417951606877427690' title='4 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/8417951606877427690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/8417951606877427690'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/09/fonction-de-vrification-demail.html' title='Fonction de vérification d&#39;Email'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2472914414356920088.post-4546123258041747824</id><published>2007-07-11T16:05:00.000+00:00</published><updated>2007-09-08T21:59:50.345+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Généralités"/><title type='text'>Introduction à PHP</title><content type='html'>&lt;center&gt;&lt;img src=&quot;http://www.elroubio.net/v/expo/vos_ele/php_to_elephpant.gif&quot; /&gt;&lt;/center&gt;&lt;span style=&quot;color: rgb(0, 0, 0);font-size:100%;&quot; &gt;Avant de commencer je vous propose un vidéo bien utile mais qui est malheureusement en anglais :&lt;br /&gt;&lt;/span&gt;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/TxW5G3iCBns&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/TxW5G3iCBns&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(102, 0, 0);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Qu&#39;est ce que PHP ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;PHP&lt;/b&gt; est un &lt;a href=&quot;http://www.commentcamarche.net/langages/langages.php3&quot;&gt;&lt;/a&gt;langage de script exécuté  du côté (comme les scripts CGI, CGI, ...) et non du côté client (ne s&#39;exécute pas sur votre ordinateur mais sur le serveur ...). La syntaxe du langage provient de celles du langage C &lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://www.commentcamarche.net/c/cintro.php3&quot;&gt;&lt;/a&gt;, du Perl et de Java&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;/span&gt;. Ses principaux atouts sont :&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Une grande communauté de développeurs partageant des centaines de milliers d&#39;exemples de script PHP ;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;La gratuité et la disponibilité du code source (PHP est distribué sous licence GNU GPL) ;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;La simplicité d&#39;écriture de scripts ;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;La possibilité d&#39;inclure le script PHP au sein d&#39;une page HTML (contrairement aux scripts CGi, pour lesquels il faut écrire des lignes de code pour afficher chaque ligne en langage HTML) ;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;La simplicité d&#39;interfaçage avec des bases de données (de nombreux SGBD  sont supportés, mais le plus utilisé avec ce langage est MySQL, un SGBD gratuit disponible sur de nombreuses plateformes :Unix, Linux, Windows, MacOs X, Solaris, etc...) ; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;L&#39;intégration au sein de nombreux serveurs web (Apache, Microsoft IIS, etc.).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Origines de PHP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Le langage PHP a été mis au point au début d&#39;automne 1994 par Rasmus Lerdorf. Ce langage de script lui permettait de conserver la trace des utilisateurs venant consulter son CV sur son site, grâce à l&#39;accès à une base de données par l&#39;intermédiaire de requêtes SQL. Ainsi, étant donné que de nombreux internautes lui demandèrent ce programme, Rasmus Lerdorf mit en ligne en 1995 la première version de ce programme qu&#39;il baptisa &lt;i&gt;Personal Sommaire Page Tools&lt;/i&gt;, puis &lt;i&gt;Personal Home Page v1.0&lt;/i&gt; (traduisez &lt;i&gt;page personnelle version 1.0&lt;/i&gt;).  &lt;/span&gt;&lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Etant donné le succès de PHP 1.0, Rasmus Lerdorf décida d&#39;améliorer ce langage en y intégrant des structures plus avancées telles que des boucles, des structures conditionnelles, et y intégra un package permettant d&#39;interpréter les formulaires qu&#39;il avait développé (&lt;i&gt;FI&lt;/i&gt;, Form Interpreter) ainsi que le support de mSQL. C&#39;est de cette façon que la version 2 du langage, baptisée pour l&#39;occasion &lt;i&gt;PHP/FI version 2&lt;/i&gt;, vit le jour durant l&#39;été 1995. Il fut rapidement utilisé sur de nombreux sites (15000 fin 1996, puis 50000 en milieu d&#39;année 1997).  &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;A partir de 1997, Zeev Suraski et Andi Gurmans rejoignirent Rasmus pour former une équipe de programmeurs afin de mettre au point PHP 3 (Stig Bakken, Shane Caraveo et Jim Winstead les rejoignirent par la suite). C&#39;est ainsi que la version 3.0 de PHP fut disponible le 6 juin 1998.  &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;A la fin de l&#39;année 1999 la version 4.0 de PHP, baptisée PHP4, est apparue. PHP en est aujourd&#39;hui à sa cinquième version.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;SGBD supportés par PHP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PHP permet un interfaçage simple avec de nombreux systèmes de gestion de bases de données&lt;/span&gt; (SGBD), parmi lesquels : &lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Adabas D&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;dBase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Empress&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;FilePro&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Informix&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Interbase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;mSQL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;MySQL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Oracle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PostgreSQL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Solid&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Sybase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Velocis&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Unix dbm&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://formation-php.blogspot.com/feeds/4546123258041747824/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2472914414356920088/4546123258041747824' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/4546123258041747824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2472914414356920088/posts/default/4546123258041747824'/><link rel='alternate' type='text/html' href='http://formation-php.blogspot.com/2007/07/quest-ce-que-php-php-est-un-langage.html' title='Introduction à PHP'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>