<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JQuery, PHP, html, design... // arnaud-k : un blog de geek &#187; php</title>
	<atom:link href="http://blog.arnaud-k.fr/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.arnaud-k.fr</link>
	<description>Le blog JQuery, Html, Web Design</description>
	<lastBuildDate>Thu, 21 Apr 2011 08:10:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Détecter l&#8217;iPad en Javascript ou PHP</title>
		<link>http://blog.arnaud-k.fr/2010/04/12/detecter-lipad-en-javascript-ou-php/</link>
		<comments>http://blog.arnaud-k.fr/2010/04/12/detecter-lipad-en-javascript-ou-php/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 11:27:11 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1664</guid>
		<description><![CDATA[Tu souhaites adapter ton site pour l&#8217;iPad ? Il faut pouvoir l&#8217;identifier afin de charger les bonnes feuilles de styles, les bons templates et les bon JavaScript. Plusieurs solutions s&#8217;offrent à toi faire la détection en PHP ou en JavaScript.&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2010/04/12/detecter-lipad-en-javascript-ou-php/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F04%2F12%2Fdetecter-lipad-en-javascript-ou-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F04%2F12%2Fdetecter-lipad-en-javascript-ou-php%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p class="aligncenter"><img src="http://blog.arnaud-k.fr/wp-content/uploads/2010/04/iPad_by_yamcharevenge.jpg" alt="" title="" width="500" height="203" class="aligncenter size-full wp-image-1666" /></p>
<p>Tu souhaites adapter ton site pour l&#8217;iPad ? Il faut pouvoir l&#8217;identifier afin de charger les bonnes feuilles de styles, les bons templates et les bon JavaScript.</p>
<p>Plusieurs solutions s&#8217;offrent à toi faire la détection en PHP ou en JavaScript. Tout d&#8217;abord voyons le Javascript :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/iPad/i</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #006600; font-style: italic;">// javascript à faire si l'iPad est détecté</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Enfin pour le PHP :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'iPad'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// PHP à faire si l'iPad est détecté</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p class="alignright"><em><a href="http://yamcharevenge.deviantart.com/art/iPad-152197039">Photo</a></em></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2010/04/12/detecter-lipad-en-javascript-ou-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Quelques fonctions PHP utiles (avec PHPfonctions)</title>
		<link>http://blog.arnaud-k.fr/2009/08/12/quelques-fonctions-php-utiles-avec-phpfonctions/</link>
		<comments>http://blog.arnaud-k.fr/2009/08/12/quelques-fonctions-php-utiles-avec-phpfonctions/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 10:13:14 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bestof]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpfonctions]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1150</guid>
		<description><![CDATA[Plusieurs mois après la mise en ligne de PHP fonctions, la bibliothèque de fonctions PHP, quelques fonctions PHP se dégagent par leur utilité et leur spécificité. Voici 3 fonctions choisies pour toi : get_last_tweets() par Adrian Gaudebert. Récupère les derniers&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/08/12/quelques-fonctions-php-utiles-avec-phpfonctions/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F12%2Fquelques-fonctions-php-utiles-avec-phpfonctions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F12%2Fquelques-fonctions-php-utiles-avec-phpfonctions%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-1151" title="phpfonctions-best-of" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/08/phpfonctions-best-of.png" alt="phpfonctions-best-of" width="600" height="200" /></p>
<p>Plusieurs mois après la mise en ligne de PHP fonctions, la bibliothèque de <a href="http://phpfonctions.php">fonctions PHP</a>, quelques fonctions PHP se dégagent par leur utilité et leur spécificité. Voici 3 fonctions choisies pour toi :</p>
<ul>
<li>
<h3><a href="http://phpfonctions.fr/fonction-php.php?fonction=get_last_tweets">get_last_tweets()</a> par <a href="http://adrian.gaudebert.fr/">Adrian Gaudebert</a>.</h3>
<p>Récupère les derniers statuts d&#8217;un compte Twitter. Parfait pour créer un mashup Twitter ou juste afficher ses derniers tweets sur son <a href="http://phpfonctions.fr/fonction-php.php?fonction=getTinyUrl">blog.</a></li>
<li>
<h3><a href="http://phpfonctions.fr/fonction-php.php?fonction=getTinyUrl">getTinyUrl()</a> (par moi-même)</h3>
<p>Permet de raccourcir une URL en utilisant l&#8217;API de Tinyurl. Très utile pour proposer des liens &laquo;&nbsp;partager sur Twitter&nbsp;&raquo; sans dépasser les 140 caractères !</li>
<li>
<h3>La <a href="http://phpfonctions.fr/fonction-php.php?fonction=class%20miniature">Classe Miniature</a> par <a href="http://www.pahtp.com/">PaHtP</a></h3>
<p>Cette classe (malheureusement en PHP 4, mais facilement adaptable à PHP 5) permet de créer la miniature d&#8217;une image avec un redimensionnement proportionnel.</li>
</ul>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/08/12/quelques-fonctions-php-utiles-avec-phpfonctions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>6 blogs à suivre : Émilie Navarro, Olybop, Dator Blog, Adrian Gaudebert, Kueny Raphaël et La Bande Pas Dessinée</title>
		<link>http://blog.arnaud-k.fr/2009/07/16/6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee/</link>
		<comments>http://blog.arnaud-k.fr/2009/07/16/6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 11:58:19 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[news du web]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[liens utiles]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=851</guid>
		<description><![CDATA[Pour le 100ème billet de ce blog (en 111 jours, la moyenne est pas mal, nan ? ), j&#8217;ai choisi de présenter quelques blogs que je suis pour certains depuis plusieurs mois et pour d&#8217;autres depuis quelques jours seulement. 5&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/07/16/6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F07%2F16%2F6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F07%2F16%2F6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Pour<strong> le 100ème billet de ce blog </strong>(en 111 jours, la moyenne est pas mal, nan ? <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />  ), j&#8217;ai choisi de présenter quelques blogs que je suis pour certains depuis plusieurs mois et pour d&#8217;autres depuis quelques jours seulement.</p>
<p>5 blogs sur les 6 que je vais présenter sont des blogs techniques (dans le domaine du web of course) et un plutôt humoristique. J&#8217;ai essayé de ne pas sélectionner des blogs que tout le monde connaît, on ne retrouvera pas ici <a href="http://www.presse-citron.net/">Presse-Citron</a>, <a href="http://www.korben.info">Korben</a>, <a href="http://blogmotion.fr/">Blogmotion</a> ou <a href="http://bienbienbien.net">BienBienBien</a> (oups, je les ai quand même cité&#8230; ).</p>
<p style="text-align: center;"><a href="http://www.emilie-navarro.fr/blog/index.php?"><img class="aligncenter size-full wp-image-853" style="margin: 20px auto;" title="emilie-navarro" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/emilie-navarro.png" alt="emilie-navarro" width="600" height="200" /></a></p>
<p>Galanterie oblige, je vais commencer par le blog d&#8217;<a href="http://www.emilie-navarro.fr/blog/index.php?">Émilie Navarro</a> qui est une webmaster dans la région toulousaine. Son blog traite de ses différentes réalisations, de ses expériences (avec Twitter par exemple), de marketing et du web en général. Ses billets sont toujours bien documentés et ses illustrations sont toujours sympas !</p>
<p style="text-align: left;"><a href="http://blog.gaborit-d.com/"><img class="aligncenter size-full wp-image-858" style="margin:20px auto;" title="olybop" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/olybop.png" alt="olybop" width="600" height="200" /></a><a href="http://blog.gaborit-d.com/">Olybop</a> est un blog qui parle surtout de deisgn et qui présente très régulièrement des illustrateurs. Ses découvertes sont souvent sympas et parfois surprenante. Tu pourras également le retrouver sur <a href="http://twitter.com/olybop">twitter</a>.</p>
<p style="text-align: left;"><a href="http://www.dator.fr/"><img class="aligncenter size-full wp-image-856" style="margin: 20px auto;" title="dator-blog" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/dator-blog.png" alt="dator-blog" width="600" height="200" /></a>Le <a href="http://www.dator.fr/">Dator Blog</a> est un blog qui parle de développement web principalement. On y retrouve pas mal de JQuery et régulièrement des présentations de plugins JQuery.</p>
<p style="text-align: left;"><a href="http://adrian.gaudebert.fr/blog/index.php?"><img class="aligncenter size-full wp-image-854" style="margin: 20px auto;" title="adrian-gaudebert" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/adrian-gaudebert.png" alt="adrian-gaudebert" width="600" height="200" /></a>J&#8217;ai découvert le blog d&#8217;<a href="http://adrian.gaudebert.fr/blog/index.php?">Adrian Gaudebert</a> il y a peu. Son profil de jeune développeur web m&#8217;a rappelé un peu le mien. Ses billets parle du web en général et de ses projets. C&#8217;est lui qui a créé le prjet &laquo;&nbsp;<a href="http://adrian.gaudebert.fr/blog/index.php?post/2009/05/31/Label-%22Ce-site-est-libre-de-tout-contr%C3%B4le-gouvernemental%22">blog libre de tout contrôle gouvernemental</a>&nbsp;&raquo; en opposition à Hadopi et Loppsi2. Il a également fait un <a href="http://adrian.gaudebert.fr/blog/index.php?post/2009/07/03/PHPFonctions%2C-pour-partager-toutes-vos-fonctions-PHP-%21">billet sympa</a> sur <a href="http://phpfonctions.fr">PHP fonctions</a> !</p>
<p style="text-align: left;"><a href="http://rkueny.fr/"><img class="aligncenter size-full wp-image-857" style="margin: 20px auto;" title="kueny-raphael" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/kueny-raphael.png" alt="kueny-raphael" width="600" height="200" /></a><a href="http://rkueny.fr/">Raphaël Kueny</a> est un développeur web PHP. Son blog parle donc de&#8230; développement web PHP ! Ses billets sur la communauté PHP, sur les news du PHP ou sa série de tutoriels sur &laquo;&nbsp;<a href="http://rkueny.fr/category/jeu-web">Comment créer un jeu web</a>&nbsp;&raquo; sont toujours intéressants et bien documentés.</p>
<p style="text-align: left;"><a href="http://www.labandepasdessinee.com/"><img class="aligncenter size-full wp-image-855" style="margin: 20px auto;" title="bande pas dessinée" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/07/bpd.png" alt="bande pas dessinée" width="600" height="200" /></a><strong>Pour finir en beauté, un blog pas technique, mais plutôt humouristique</strong> : <a href="http://www.labandepasdessinee.com/bpd/">La bande pas dessinée</a> ! Un blog BD qui présente régulièrement des planches (souvent à trois cases) où le pas concept c&#8217;est d&#8217;avoir des pas personnages. On retrouve uniquement les bulles. Si tu as un peu de temps cet été sur la plage, je ne peux que te recommander de les lire tous depuis le début. Attention, il faut aimer le second degrès et l&#8217;humour noir ! <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/07/16/6-blogs-a-suivre-emilie-navarro-olybop-dator-blog-adrian-gaudebert-kueny-raphael-et-la-bande-pas-dessinee/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Tutoriel : utilisation de Gravatar en PHP</title>
		<link>http://blog.arnaud-k.fr/2009/06/17/tutoriel-utilisation-de-gravatar-en-php/</link>
		<comments>http://blog.arnaud-k.fr/2009/06/17/tutoriel-utilisation-de-gravatar-en-php/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 10:28:51 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=713</guid>
		<description><![CDATA[Pour le développement d&#8217;un site que j&#8217;ai en cours, j&#8217;ai dû intégrer directement les Gravatars aux membres postant des commentaires. J&#8217;ai été tout bonnement étonné de la simplicité à mettre en place en PHP. Tout ça est en complément de&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/06/17/tutoriel-utilisation-de-gravatar-en-php/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F17%2Ftutoriel-utilisation-de-gravatar-en-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F17%2Ftutoriel-utilisation-de-gravatar-en-php%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Pour le développement d&#8217;un site que j&#8217;ai en cours, j&#8217;ai dû intégrer directement les <a href="http://fr.gravatar.com">Gravatars</a> aux membres postant des commentaires. J&#8217;ai été tout bonnement <strong>étonné de la simplicité à mettre en place en PHP</strong>. Tout ça est en complément de tous les plugins et intégration native sur les CMS et plateformes de blog (Drupal, Joomla, Dotclear ou WordPress).</p>
<p><img class="aligncenter size-full wp-image-714" title="gravatar" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/06/gravatar.png" alt="gravatar" /></p>
<p>Pour rappel, un Gravatar (Globally Recognized Avatar) est <strong>une image qui vous suit sur tous les sites</strong> qui proposent leur intégration. Par exemple sur le blogs WordPress, quand un commentaire est laché, l&#8217;adresse email est demandé et à partir de cet adresse email, Gravatar retourne l&#8217;avatar de l&#8217;utilisateur. C&#8217;est aussi simple que ça.</p>
<p>C&#8217;est parfaitement intégrable sur tous les sites. <strong>Aucune inscription n&#8217;est nécessaire</strong> !</p>
<p>Voici comment le mettre en place en PHP :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;arnaud-k@machin.com&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// l'adresse email de l'utilisateur</span>
<span style="color: #000088;">$default</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.machin.com/avatar-par-defaut.jpg&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// l'url de l'image à afficher par défaut si l'utilisateur n'a pas de Gravatar</span>
<span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">40</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// la taille pour l'affichage du gravatar (celui-ci sera carré)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// on construit ensuite l'url du Gravatar</span>
<span style="color: #000088;">$gravatar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.gravatar.com/avatar.php?gravatar_id=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;amp;default=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$default</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;amp;size=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$size</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p style="margin-top:30px">Il n&#8217;y a plus qu&#8217;à afficher le Gravatar en html :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $gravatar ?/&gt;</span></span>&quot; alt=&quot;nom du membre&quot; /&gt;</pre></div></div>



<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/06/17/tutoriel-utilisation-de-gravatar-en-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial API Youtube : rechercher et afficher des vidéos (PHP et JQuery)</title>
		<link>http://blog.arnaud-k.fr/2009/06/05/tutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery/</link>
		<comments>http://blog.arnaud-k.fr/2009/06/05/tutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 11:34:55 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[API youtube]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=623</guid>
		<description><![CDATA[J&#8217;ai eu très récemment l&#8217;occasion de travailler sur l&#8217;API de Youtube. Cette API, évidemment fourni par Google, est très complète et peut permettre beaucoup d&#8217;interactions avec Youtube (recherche et visionnage de vidéos, upload, login, &#8230;). La documentation fourni par Google&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/06/05/tutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F05%2Ftutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F05%2Ftutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-624" title="Tutoriel API Youtube" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/06/youtube.png" alt="Tutoriel API Youtube" width="600" height="200" /></p>
<p>J&#8217;ai eu très récemment l&#8217;occasion de travailler sur l&#8217;<strong>API de Youtube</strong>. Cette API, évidemment fourni par Google, est très complète et peut permettre beaucoup d&#8217;interactions avec Youtube (recherche et visionnage de vidéos, upload, login, &#8230;). La documentation fourni par Google est, comment dire, un peu fouilli et pas très claire.</p>
<p>Je vais néanmoins te partager mes découvertes en proposant un tutorial pour rechercher des vidéos sur Youtube, afficher les résultats (sous forme de miniature) et lire les vidéos.</p>
<p><a href="http://www.awelty.fr/arnaud-k/youtube/" class="demo" title="Demo Api Youtube">Demo Api Youtube</a></p>
<p>Comme d&#8217;hab, j&#8217;ai préparé une <strong><a href="http://www.awelty.fr/arnaud-k/youtube/">démo de ce tutorial</a></strong> (démo hébergée chez mon employeur car mon hébergement 1&amp;1 n&#8217;est pas PHP 5). Comme c&#8217;est du PHP, j&#8217;ai également prévu le <a href="http://blog.arnaud-k.fr/youtube/APIyoutube.zip">téléchargement</a><strong> des sources de la démo</strong>.</p>
<p>Tout d&#8217;abord il est absolument nécessaire d&#8217;avoir <strong>un serveur PHP 5.2</strong> au minimum. Il faut également télécharger un standalone du framework PHP zend, <a href="http://framework.zend.com/download/gdata">GData</a> qui contient les fichiers nécessaires au fonctionnement de l&#8217;API. Enfin pour juste effectuer des recherches et afficher des vidéos, il n&#8217;est pas nécessaire d&#8217;avoir une key pour l&#8217;API Youtube.</p>
<p>Dans le .zip de GData, il y a un dossier &laquo;&nbsp;librairy&nbsp;&raquo; dans lequel on retrouve un dossier &laquo;&nbsp;Zend&nbsp;&raquo;, c&#8217;est celui-là qu&#8217;il faut uploader à la racine de ton site.</p>
<p><span style="color:#ffa800; font-size:1.3em; font-weight:bold">Jetons maintenant un oeil au code :</span></p>
<p>Le principe est le suivant : on fait une requête (en utlisant les objets mis à disposition par l&#8217;API) et on récupère et on traite les informations à partir du flux XML retourné (<a href="http://code.google.com/intl/fr/apis/youtube/2.0/developers_guide_php.html#Video_Entry_Contents">voir la liste des infos disponible</a>).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Gdata/YouTube.php'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on charge la librairie YouTube</span>
&nbsp;
<span style="color: #000088;">$yt</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Gdata_YouTube<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on initialise l'objet Youtube</span>
<span style="color: #000088;">$yt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMajorProtocolVersion</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$yt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">newVideoQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setOrderBy</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'relevance'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// les vidéos sont classées par pertinence</span>
<span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all_time'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on souhaite afficher les vidéos qui ont été ajoutées n'importe quand</span>
<span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setVideoQuery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;fat freddy's drop&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on définit la recherche</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// on récupère un flux XML avec la liste des vidéos</span>
<span style="color: #000088;">$flux</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$yt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVideoFeed</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// on affiche les miniatures </span>
get_results<span style="color: #009900;">&#40;</span><span style="color: #000088;">$flux</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>La fonction get_results() est une fonction permettant de parcourir le flux XML des résultats pour le traitement des informations. Cette fonction appelle elle-même la fonction afficheMiniature() qui permet d&#8217;afficher les miniatures des vidéos. Ici, je stoppe le listing des résultats à 6, mais on peut en afficher jusqu&#8217;à 25.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/******** FONCTIONS POUR L'API YOUTUBE ********/</span>
<span style="color: #666666; font-style: italic;">// On recupère l'url du player flash et une miniature de la video (format 120*90)</span>
<span style="color: #666666; font-style: italic;">// et on affiche la miniature en mettant l'url du player en id (pour le récupérer avec JQuery après)</span>
<span style="color: #000000; font-weight: bold;">function</span> afficheMiniature<span style="color: #009900;">&#40;</span><span style="color: #000088;">$video</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$miniature</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$video</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVideoThumbnails</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img class=&quot;videoThumb&quot; id=&quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$video</span><span style="color: #339933;">-/&gt;</span>getFlashPlayerUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$miniature</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; alt=&quot;&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// fonction permettant de parcourir les vidéos provenant d'un flux</span>
<span style="color: #000000; font-weight: bold;">function</span> get_results<span style="color: #009900;">&#40;</span><span style="color: #000088;">$videos</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$videos</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$video</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		afficheMiniature<span style="color: #009900;">&#40;</span><span style="color: #000088;">$video</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$count</span><span style="color: #339933;">++;</span>
	    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Enfin, j&#8217;ai ajouté un petit code JQuery pour permettre l&#8217;affichage d&#8217;un seul player flash (s&#8217;il y en a plusieurs sur une page, celle-ci peut galérer un peu) et de changer la vidéo lorsque l&#8217;on clique sur une miniature. Par défaut (au chargement de la page) on affiche la première vidéo.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">/* ##########
		AFFICHAGE DYNAMIQUE DES VIDEOS
	########## */</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#lectureVideo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// afficher une video au chargement de la page si le div ayant pour id lectureVideo</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> urlVideo <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img.videoThumb:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#lectureVideo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;object width=&quot;360&quot; height=&quot;300&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;'</span><span style="color: #339933;">+</span>urlVideo<span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;color1=0x2193bd&amp;color2=0x2193bd&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;'</span><span style="color: #339933;">+</span>urlVideo<span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;color1=0x2193bd&amp;color2=0x2193bd&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;360&quot; height=&quot;300&quot;&gt;&lt;/embed&gt;&lt;/object&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img.videoThumb&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// si on clique sur une miniature on affiche la vidéo dans le bloc ayant pour id &quot;lectureVideo&quot;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#lectureVideo&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;object width=&quot;360&quot; height=&quot;300&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;'</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;color1=0x2193bd&amp;color2=0x2193bd&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;'</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;color1=0x2193bd&amp;color2=0x2193bd&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;360&quot; height=&quot;300&quot;&gt;&lt;/embed&gt;&lt;/object&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Pour voir la structure HTML que j&#8217;ai utilisé, je t&#8217;invite à regarder le code de la démo (CTRL+U sous firefox). C&#8217;est à toi de jouer maintenant ! <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Toute la code officielle est <a href="http://code.google.com/intl/fr-FR/apis/youtube/overview.html">disponible ici</a>.</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/06/05/tutorial-api-youtube-rechercher-et-afficher-des-videos-php-et-jquery/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tutorial JQuery : effet de suppression Ajax à la WordPress</title>
		<link>http://blog.arnaud-k.fr/2009/06/03/tutorial-jquery-effet-de-suppression-ajax-a-la-wordpress/</link>
		<comments>http://blog.arnaud-k.fr/2009/06/03/tutorial-jquery-effet-de-suppression-ajax-a-la-wordpress/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 11:05:46 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin JQuery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=608</guid>
		<description><![CDATA[Dans l&#8217;admin de WordPress (qui utilise JQuery), il y des légers effets de couleurs, d&#8217;apparition. Je trouve qu&#8217;ils ont un rendu qui fait assez classe. Je te propose donc un tutorial pour faire plus ou moins le même effet. Pour&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/06/03/tutorial-jquery-effet-de-suppression-ajax-a-la-wordpress/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F03%2Ftutorial-jquery-effet-de-suppression-ajax-a-la-wordpress%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F06%2F03%2Ftutorial-jquery-effet-de-suppression-ajax-a-la-wordpress%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Dans l&#8217;admin de WordPress (qui utilise JQuery), il y des légers effets de couleurs, d&#8217;apparition. Je trouve qu&#8217;ils ont un rendu qui fait assez classe.</p>
<p>Je te propose donc un tutorial pour faire plus ou moins le même effet. Pour l&#8217;effet de transition de couleur il est nécessaire d&#8217;avoir le plugin JQuery.color (<a href="http://blog.arnaud-k.fr/effetSuppr/jquery.color.js">dispo ici</a>) et le plugin JQuery.delay pour une meilleure fluidité (au moment de l&#8217;appel en Ajax, <a href="http://blog.arnaud-k.fr/effetSuppr/jquery.delay.js">dispo ici</a>)</p>
<p><a class="demo" title="voir la démo" href="http://blog.arnaud-k.fr/effetSuppr/">Voir la démo</a></p>
<p>Comme d&#8217;habitude, on commence par inporter la librairie JQuery et les plugins nécessaires :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.color.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.delay.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>Ensuite on prépare la structure HTML des éléments à supprimer. J&#8217;ai choisi des paragraphes (balises &lt;p&gt;) pour que ce soit le plus simple possible, mais libre à vous de le changer et par conséquent de changer les sélecteurs JQuery.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Premier élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- on place dans l'attribut rel l'id de l'element à supprimer --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Deuxième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Troisième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Quatrième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;4&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Cinquième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;5&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Sixième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;6&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Septième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;7&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Huitième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;8&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Neuvième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;9&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Dixième élément <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;supprimer&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span>&gt;</span>Supprimer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<p>Enfin, la plus grosse partie : le code JQuery. Les commentaires sont directement dans le code (ils sont également dans le code de la page de démo).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.supprimer'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// quand on clique sur un lien supprimer</span>
		e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// annule l'effet du lien pour pas recharger la page</span>
		<span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on recupere l'id de l'element a supprimer (qui est dans l'attribut rel du lien)</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">confirm</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Supprimer cet élément ?'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// on demande une confirmation</span>
			<span style="color: #003366; font-weight: bold;">var</span> parent <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on recupere le paragraphe parent du lien (qui contient l'element a supprimer)</span>
			$.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> 
				type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// les variables seront passées en POST (comme d'hab pour les recuperer en php $_POST[id] par exemple)</span>
				url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;suppr.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// on appelle le fichier php suppr.php qui supprimer l'element de la base de donnees (dans mon cas, ce fichier est vide)</span>
				data<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;id=&quot;</span><span style="color: #339933;">+</span>id<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&amp;act=suppr&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// variable que l'on passe au fichier php</span>
				beforeSend<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					parent.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'backgroundColor'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'#FF3F47'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// animation a faire avant l'envoi (on change le fond avec un fondu jusqu'à la couleur #FF3F47)</span>
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
				success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// en cas de succes</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1200</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// on attend 1.2 secondes</span>
							parent.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// et on fait disparaitre l'element en l'enroulant</span>
							<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>



<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/06/03/tutorial-jquery-effet-de-suppression-ajax-a-la-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>phpfonctions, premier bilan et choses à faire</title>
		<link>http://blog.arnaud-k.fr/2009/05/21/phpfonctions-premier-bilan-et-choses-a-faire/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/21/phpfonctions-premier-bilan-et-choses-a-faire/#comments</comments>
		<pubDate>Thu, 21 May 2009 10:49:00 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bilan]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpfonctions]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=559</guid>
		<description><![CDATA[Voilà, ça fait maintenant une semaine que j&#8217;ai mis en ligne phpfonctions (pour rappel phpfonctions est une bibliothèque de fonctions php). Le premier bilan que je peux en tirer est plutôt positif. Tout d&#8217;abord en terme de fonctions ajoutées :&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/21/phpfonctions-premier-bilan-et-choses-a-faire/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F21%2Fphpfonctions-premier-bilan-et-choses-a-faire%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F21%2Fphpfonctions-premier-bilan-et-choses-a-faire%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Voilà, ça fait maintenant une semaine que j&#8217;ai mis en ligne <a href="http://phpfonctions.fr">phpfonctions</a> (pour rappel phpfonctions est <strong>une bibliothèque de <a href="http://phpfonctions.fr">fonctions php</a></strong>). Le premier bilan que je peux en tirer est plutôt positif. Tout d&#8217;abord en terme de fonctions ajoutées : on peut en compter aujourd&#8217;hui <strong>une bonne quarantaine</strong>. Mais c&#8217;est surtout leur variété qui me plaît bien.</p>
<p>Ensuite, en terme de visites, <strong>lundi a été une journée record avec plus de 900 visites</strong> ! Ca redescend tout doucement pour arriver à un total d&#8217;environs 300 visiteurs hier. Au total ce sont <strong>2 224 visiteurs au total</strong> qui sont venus lors de la première semaine (avec plus de <strong>10 000 pages vues</strong> <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' />  )</p>
<p><img class="aligncenter size-full wp-image-561" title="php fonctions, premier bilan" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/ilovephp.jpg" alt="php fonctions, premier bilan" width="504" height="200" /></p>
<p>Ce qui a fait la différence, c&#8217;est surtout<strong> les articles sur divers blogs et portails</strong>, avec tout d&#8217;abord Adrien (fidèle lecteur <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) et son blog <a href="http://www.tilacica.com/phpfonctions-bibliotheque-de-fonctions-php,315.html">Tilàcica</a> qui a été le premier sur le coup, puis des articles sur <a href="http://mtnconcept.com/free-tools/code/phpfontions-bibliotheque-de-fonctions-php-en-ligne-961">FreeTools</a>, <a href="http://www.jarodxxx.com/index.php?post/2009/05/16/PhpFonctions%2C-la-bibliotheque-de-fonctions-php">Jarodxxx</a>, <a href="http://www.nexen.net/actualites/php/19069-phpfonctions.php">Nexen</a>, <a href="http://rkueny.fr/developpement-web/phpfonctions">rkueny</a>, <a href="http://www.dominique-girolt.fr/developpement-web/phpfonctions-une-bibliotheque-de-fonctions-php/">dominique-girolt</a>, <a href="http://www.lephpfacile.com/news/4380-phpfonctions">phpfacile</a>, et enfin <a href="http://www.neosting-press.fr/archives/1913">neosting-press</a>. Je les remercie bien entendu tous !</p>
<p>Niveau référencement, Google a l&#8217;air d&#8217;apprécier phpfonctions, en effet sur la <strong>requête fonctions php, il sort sur la première page</strong> en 7-8ème position. Pour ça, il me reste plus qu&#8217;à attendre un peu pour éventuellement recadrer les mots-clés.</p>
<p>Enfin, diverses fonctionnalités ont déjà été ajoutées comme<strong> la <a href="http://phpfonctions.fr/categorie-de-fonctions-php.php?categorie=formulaires">navigation par catégorie</a> ou la possibilité de <a href="http://phpfonctions.fr/rechercher-fonctions-php.php">rechercher une fonction php</a></strong>. J&#8217;ai également eu (en plus des articles cités ci-dessus) quelques propositions ou suggestions intéressantes de la part de <a href="http://twitter.com/Neiths">@neiths</a> (avec son <a href="http://www.emilie-navarro.fr/blog/">blog sympa</a>), <a href="http://twitter.com/dryzer">@dryzer</a>, Cydelic et Mazzu (directement sur <a href="http://blog.arnaud-k.fr/2009/developpement-web/mise-en-ligne-de-phpfonctions/#comment-214">le blog</a>). Je pense que tout bientôt seront disponibles <strong>les flux RSS des commentaires</strong>, un petit encart fonctions php similaires, et <strong>pourquoi pas une API</strong> permettant à divers sites de reprendre le contenu. Pour certaines propositions (comme l&#8217;insertion des classes ou de tutoriels) il faut encore que je réfléchisse, car je voulais garder ce site le plus simple possible sans que ça devienne un portail ou une usine à gaz.</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/21/phpfonctions-premier-bilan-et-choses-a-faire/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Mise en ligne de phpfonctions !</title>
		<link>http://blog.arnaud-k.fr/2009/05/14/mise-en-ligne-de-phpfonctions/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/14/mise-en-ligne-de-phpfonctions/#comments</comments>
		<pubDate>Thu, 14 May 2009 20:47:36 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpfonctions]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=530</guid>
		<description><![CDATA[J&#8217;ai le plaisir, l&#8217;honneur de vous annoncer en exclusivité la mise en ligne du site php fonctions J&#8217;ai pu finir les dernières fonctionnalités nécessaires au bon fonctionnement de base du site : le flux RSS des dernières fonctions, les commentaires&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/14/mise-en-ligne-de-phpfonctions/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F14%2Fmise-en-ligne-de-phpfonctions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F14%2Fmise-en-ligne-de-phpfonctions%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://phpfonctions.fr"><img class="aligncenter size-full wp-image-531" title="mise en ligne de php fonctions" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/php-fonctions-mel.png" alt="mise en ligne de php fonctions" width="600" height="300" /></a></p>
<h3>J&#8217;ai le plaisir, l&#8217;honneur de vous annoncer en exclusivité la mise en ligne du site <a href="http://phpfonctions.fr">php fonctions</a></h3>
<p>J&#8217;ai pu finir les dernières fonctionnalités nécessaires au bon fonctionnement de base du site : le <a href="http://feeds2.feedburner.com/phpfonctions">flux RSS</a> des dernières fonctions, <strong>les commentaires des fonctions</strong> (avec la possibilité d&#8217;ajouter du code dans les commentaires), le footer et deux trois petites choses pour optimiser le référencement.</p>
<p>J&#8217;ai entièrement créé et développé ce site. Il est basé sur un projet interne à <a href="http://www.awelty.fr">Awelty</a> (la boîte pour laquelle je bosse). En effet, le premier jour j&#8217;ai dû développer une mini-bibliothèque de fonctions (php et javascript) pour l&#8217;usage exclusif de l&#8217;équipe des développeurs d&#8217;awelty (qui compte&#8230; 2 membres). Il faut donc rendre à <a href="http://twitter.com/tonysamson">@tonySamson</a> ce qui appartient à Tony.</p>
<p>J&#8217;ai prévu d&#8217;ajouter d&#8217;<strong>autres fonctionnalités</strong> telles la navigation par catégorie, un formulaire de recherche de fonction, d&#8217;autres flux RSS (par catégorie et les dernières fonctions ayant une certaine note)&#8230; Bref, les idées ne manquent pas. D&#8217;ailleurs si tu as des suggestions ou si tu vois des bugs (mais ça j&#8217;y crois pas trop <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) <strong>n&#8217;hésite pas à laisser un petit commentaire</strong> ici !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/14/mise-en-ligne-de-phpfonctions/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>API géolocalisation adresse IP avec iplocationtools</title>
		<link>http://blog.arnaud-k.fr/2009/05/14/api-geolocalisation-dadresse-ip-avec-iplocationtools/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/14/api-geolocalisation-dadresse-ip-avec-iplocationtools/#comments</comments>
		<pubDate>Thu, 14 May 2009 11:53:19 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[geolocalisation]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=524</guid>
		<description><![CDATA[J&#8217;avais un peu étudié les différentes solutions d&#8217;API de géolocalisation d&#8217;adresse IP il y a quelques temps. J&#8217;étais sur cette solution tout simple : iplocationtools. Iplocationtools est une API que l&#8217;on peut appeler directement en PHP (voir le code ci-dessous).&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/14/api-geolocalisation-dadresse-ip-avec-iplocationtools/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F14%2Fapi-geolocalisation-dadresse-ip-avec-iplocationtools%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F14%2Fapi-geolocalisation-dadresse-ip-avec-iplocationtools%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-525" title="geolocalisation d'adresse ip" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/geoloc.png" alt="geolocalisation d'adresse ip" width="600" height="200" /></p>
<p>J&#8217;avais un peu étudié les différentes solutions d&#8217;<strong>API de géolocalisation d&#8217;adresse IP</strong> il y a quelques temps. J&#8217;étais sur cette solution tout simple : <a href="http://iplocationtools.com/">iplocationtools</a>.</p>
<p>Iplocationtools est une API que l&#8217;on peut appeler directement en PHP (voir le code ci-dessous). Cela crée un fichier XML contenant toutes les infos nécessaires à la géolocalisation (<strong>pays, region, ville, latitude et longitude </strong>principalement). Il ne reste plus qu&#8217;à le parser.</p>
<p>Code à intégrer pour appeler l&#8217;API :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> locateIp<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.iplocationtools.com/ip_query.php?ip=<span style="color: #006699; font-weight: bold;">$ip</span>&amp;output=xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on charge l'api</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$d</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Failed to open connection</span>
&nbsp;
    <span style="color: #000088;">$answer</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Status</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'OK'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Invalid status code</span>
&nbsp;
        <span style="color: #000088;">$country_code</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CountryCode</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$country_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CountryName</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$region_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RegionName</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$city</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">City</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$zippostalcode</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ZipPostalCode</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$latitude</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Latitude</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$longitude</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Longitude</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//Return the data as an array</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latitude'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$latitude</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'longitude'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$longitude</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'zippostalcode'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$zippostalcode</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'city'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$city</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'region_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$region_name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'country_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$country_name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'country_code'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$country_code</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ip'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A toi de jouer maintenant !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/14/api-geolocalisation-dadresse-ip-avec-iplocationtools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>php fonctions, suite du développement</title>
		<link>http://blog.arnaud-k.fr/2009/05/13/php-fonctions-suite-du-developpement/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/13/php-fonctions-suite-du-developpement/#comments</comments>
		<pubDate>Wed, 13 May 2009 08:30:30 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[développement]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpfonctions]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=519</guid>
		<description><![CDATA[Le développement de php fonctions avance à grands pas ! La sortie intergalactique du site devrait se faire dans la nuit de jeudi à vendredi. Le coeur du site fonctionne déjà (ajout de fonctions, parcours des fonctions et visionner une&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/13/php-fonctions-suite-du-developpement/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F13%2Fphp-fonctions-suite-du-developpement%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F13%2Fphp-fonctions-suite-du-developpement%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-520" title="php fonctions developpement" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/php-fonctions-dev.png" alt="php fonctions developpement" width="600" height="200" /></p>
<p>Le développement de <a href="http://phpfonctions.fr">php fonctions</a> avance à grands pas ! La sortie intergalactique du site devrait se faire dans la nuit de jeudi à vendredi. Le coeur du site fonctionne déjà (ajout de fonctions, parcours des fonctions et visionner une fonction).</p>
<p>Viendront aussi la possibilité de noter une fonction, de commenter les fonctions (avec ajout de code dans les commentaires) et les divers flux RSS (leurs nombres n&#8217;est pas encore arrêté). Enfin un petit coup d&#8217;url rewriting et ce sera bouclé <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .</p>
<p>A bientôt donc !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/13/php-fonctions-suite-du-developpement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Développement en cours : phpfonctions</title>
		<link>http://blog.arnaud-k.fr/2009/05/07/developpement-en-cours-phpfonctions/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/07/developpement-en-cours-phpfonctions/#comments</comments>
		<pubDate>Thu, 07 May 2009 12:12:26 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpfonctions]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=483</guid>
		<description><![CDATA[J&#8217;ai commencé en début de semaine, la création du site phpfonctions. Mon objectif est de créer une bibliothèque de fonctions php en ligne. Bien sûr cela sera un site collaboratif, ouvert à tous les web développeurs . Il n&#8217;y aura&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/07/developpement-en-cours-phpfonctions/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F07%2Fdeveloppement-en-cours-phpfonctions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F07%2Fdeveloppement-en-cours-phpfonctions%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>J&#8217;ai commencé en début de semaine, la création du site phpfonctions. Mon objectif est de créer une <a href="http://www.phpfonctions.fr">bibliothèque de fonctions php en ligne</a>. Bien sûr cela sera un site collaboratif, ouvert à tous les web développeurs <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  . Il n&#8217;y aura (normalement) aucune inscription nécessaire pour participer. Un simple système de notation et de tags permettra de trier et de mieux naviguer parmi les fonctions.</p>
<p><strong>Lancement d&#8217;une première version</strong> de test (sans bugs <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ) dans <strong>le courant de la semaine prochaine</strong> (normalement) !</p>
<p><img class="aligncenter size-full wp-image-484" title="phpfonctions, bibliothèque de fonctions php en ligne" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/phpfonctions.png" alt="phpfonctions, bibliothèque de fonctions php en ligne" width="600" height="200" /></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/07/developpement-en-cours-phpfonctions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Solution d&#8217;import de contact en PHP (GMail, Hotmail, Twitter&#8230;) : OpenInviter</title>
		<link>http://blog.arnaud-k.fr/2009/05/06/solution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/06/solution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter/#comments</comments>
		<pubDate>Wed, 06 May 2009 12:37:08 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[GMail]]></category>
		<category><![CDATA[openinviter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=476</guid>
		<description><![CDATA[J&#8217;ai découvert il y a peu, cette solution d&#8217;import de contact via des webmail ou des réseau sociaux. OpenInviter permet donc de proposer un système d&#8217;invitation sur n&#8217;importe quel site. Beaucoup de webmails et de réseau sociaux sont disponibles :&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/06/solution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F06%2Fsolution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F06%2Fsolution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>J&#8217;ai découvert il y a peu, cette solution d&#8217;import de contact via des webmail ou des réseau sociaux. <a href="http://openinviter.com">OpenInviter</a> permet donc de proposer un système d&#8217;invitation sur n&#8217;importe quel site. Beaucoup de webmails et de réseau sociaux sont disponibles : GMail, Hotmail, Yahoo Mail, Twitter, MySpace, Skyblog &#8230; (en ce moment, ça ne fonctionne pas avec Facebook).</p>
<p>Pour mettre en place cet outil, il faut s&#8217;inscrire sur le site d&#8217;<a href="http://openinviter.com">OpenInviter</a> et téléchager tous les fichiers nécessaires. Un exemple est même fourni avec, il ne reste plus qu&#8217;à l&#8217;adapter à ton site ! Des connaissances en PHP sont quand même nécessaires pour comprendre la logique de l&#8217;outil.</p>
<p>Je suis en train de le mettre en place sur un premier site (<a href="http://www.coconews.com">Coconews</a>) et d&#8217;autres installations devrait suivre !</p>
<p><a href="http://openinviter.com"><img class="aligncenter size-full wp-image-478" title="openinviter, importer vos contacts via GMail, Hotmail, Twitter..." src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/openinviter.jpg" alt="openinviter, importer vos contacts via GMail, Hotmail, Twitter..." width="600" height="300" /></a></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/06/solution-dimport-de-contact-en-php-gmail-hotmail-twitter-openinviter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utiliser les fonctions php en JavaScript avec PHP-JS</title>
		<link>http://blog.arnaud-k.fr/2009/05/04/utiliser-les-fonctions-php-en-javascript-avec-php-js/</link>
		<comments>http://blog.arnaud-k.fr/2009/05/04/utiliser-les-fonctions-php-en-javascript-avec-php-js/#comments</comments>
		<pubDate>Mon, 04 May 2009 10:11:45 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[fonctions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=454</guid>
		<description><![CDATA[Lorsque l&#8217;on a l&#8217;habitude de coder en php avec ses multiples fonctions natives (avec ses fonctions de date, sur les tableaux, les chaînes de caractère&#8230;), on a parfois du mal à s&#8217;y retrouver en JavaScript. C&#8217;est de ce constat qu&#8217;est&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/05/04/utiliser-les-fonctions-php-en-javascript-avec-php-js/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F04%2Futiliser-les-fonctions-php-en-javascript-avec-php-js%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F05%2F04%2Futiliser-les-fonctions-php-en-javascript-avec-php-js%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Lorsque l&#8217;on a l&#8217;habitude de coder en php avec ses multiples fonctions natives (avec ses fonctions de date, sur les tableaux, les chaînes de caractère&#8230;), on a parfois du mal à s&#8217;y retrouver en JavaScript.</p>
<p>C&#8217;est de ce constat qu&#8217;est parti le projet <a href="http://phpjs.org">PHP-JS</a>. <strong>PHP-JS permet l&#8217;utilisation des fonctions natives de php en JavaScript !</strong> Pour le moment <strong>386 fonctions</strong> sont disponibles. Pour créer cela, ils ont simplement re-coder les fonctions php en JavaScript. On retrouve toute sorte de fonctions de l&#8217;include() (qui ajoute les balises script) à date() en passant par in_array() (pour savoir si un élément est dans un tableau).</p>
<p><img src="file:///tmp/moz-screenshot.jpg" alt="" /> Le pack complet de fonction est <strong>disponible en téléchargement</strong> sur le site, mais je vous recommande d&#8217;utiliser l&#8217;outil qui permet de <a href="http://phpjs.org/packages/configure">générer un fichier js</a> contenant uniquement les  fonctions qui seront nécessaires.</p>
<p><a href="http://phpjs.org"><img class="aligncenter size-full wp-image-455" title="php-js" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/05/php-js.png" alt="php-js" width="600" height="300" /></a></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/05/04/utiliser-les-fonctions-php-en-javascript-avec-php-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial : suggestions (auto-complétion) en Ajax avec JQuery et Php</title>
		<link>http://blog.arnaud-k.fr/2009/04/28/tutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php/</link>
		<comments>http://blog.arnaud-k.fr/2009/04/28/tutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 11:47:22 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[auto-complétion]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suggestion]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=390</guid>
		<description><![CDATA[Pour ce deuxième tutoriel sur l&#8217;ajax, je te propose un formulaire avec auto-complétion. Simplement afficher des suggestions quand l&#8217;utilisateur commence à taper dans un champ de texte. Les suggestions sont affichées grâce à Ajax qui permet d&#8217;effectuer des requêtes SQL&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/04/28/tutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F28%2Ftutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F28%2Ftutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Pour ce deuxième tutoriel sur l&#8217;ajax, je te propose <strong>un formulaire avec auto-complétion</strong>. Simplement afficher des suggestions quand l&#8217;utilisateur commence à taper dans un champ de texte. Les suggestions sont affichées grâce à Ajax qui permet d&#8217;effectuer des requêtes SQL en &laquo;&nbsp;arrière-plan&nbsp;&raquo; de la page. Toute la partie JavaScript sera faite grâce au framework JQuery.</p>
<p><img class="aligncenter size-full wp-image-391" title="auto-completion avec Ajax et Jquery" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/auto-completion.png" alt="auto-completion avec Ajax et Jquery" width="600" height="200" /></p>
<p>Comme d&#8217;hab, j&#8217;ai préparé <strong>une page de démo du script : <a href="http://blog.arnaud-k.fr/autoComplete/">disponible ici</a></strong>. Et il est également possible de <a href="http://blog.arnaud-k.fr/autoComplete/autoComplete.zip">télécharger les fichiers sources de cette démo</a>. Et bien sûr, tout le code présenté ici est dépouillé de toute mise en forme (libre à toi de le personnaliser après !).</p>
<p><a class="demo" title="démo JQuery : auto-complétion" href="http://blog.arnaud-k.fr/autoComplete/">Jquery : auto-complétion</a></p>
<p>Donc, pour commencer, on va préparer le code HTML nécessaire : le champ de texte sur lequel les suggestions vont être appliqué et le bloc (caché au début de la page) qui va éventuellement contenir les suggestions :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		Rechercher un pays :
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inputString&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--  champ texte à analyser pour les suggestions --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;suggestionsBox&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;suggestions&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;display: none;&quot;</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- bloc contenant les eventuelles suggestions --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;upArrow.png&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;position: relative; top: -12px; left: 30px;&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;upArrow&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- image de la fleche vers le haut --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;suggestionList&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autoSuggestionsList&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- liste contenant les suggestions --&gt;</span>
			<span style="color: #ddbb00;">&amp;nbsp;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Ensuite, dans <strong>le code javascript</strong>, on retrouve <strong>les deux fonctions nécessaires</strong> : lookup qui permet de faire l&#8217;appel ajax et fill qui permet, comme son nom l&#8217;indique, de remplir le champ avec la valeur suggerée. Après avoir défini les deux fonctions, on ajoute les &laquo;&nbsp;écouteurs&nbsp;&raquo; (qui permettent de surveiller si un événement est effectué) avec keyup (quand on appuie sur le clavier, à la remontée de la touche) et blur (quand le champ texte perd le focus).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> lookup<span style="color: #009900;">&#40;</span>inputString<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputString.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// si le champs txte est vide</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#suggestions'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on cache les suggestions</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// sinon</span>
			$.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>queryString<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">+</span>inputString<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// on envoit la valeur du champ texte dans la variable post queryString au fichier ajax.php</span>
				<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#suggestions'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// si il y a un retour, on affiche la liste</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#autoSuggestionsList'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// et on remplit la liste des données</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> fill<span style="color: #009900;">&#40;</span>thisValue<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// remplir le champ texte si une suggestion est cliquée</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#inputString'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>thisValue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;$('#suggestions').hide();&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// lorsque la page est entierement chargée</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#inputString&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// si on presse une touche du clavier en étant dans le champ texte qui a pour id inputString</span>
		lookup<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#inputString&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// si le champs texte perd le focus</span>
		fill<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Enfin, il ne reste plus qu&#8217;à développer le php qui sera exécuté grâce à l&#8217;appel ajax. Dans ce script, on  récupère la valeur passée (ce qui est saisi dans le champ texte) et il n&#8217;y a plus qu&#8217;à <strong>faire une requête SQL dans la base de données</strong> et d&#8217;afficher les résultats sous forme de liste (avec en prime un petit onClick=fill() sur chaque élément de liste permettant de remplir le champ texte.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">﻿<span style="color: #339933;">&lt;</span> ?php	
&nbsp;
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hote de la base&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;login&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pass&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Impossible de se connecter : &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;db278690514&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// si une variable queryString a été posté</span>
               <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'queryString'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// si la longueur du contenu de la variable est superieur à 0			</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queryString</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// requete sql à personnaliser pour correspondre à votre base de données</span>
				<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT value FROM countries WHERE value LIKE '<span style="color: #006699; font-weight: bold;">$queryString</span>%' LIMIT 10&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					<span style="color: #666666; font-style: italic;">// on parcourt les resultats</span>
					<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pays</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// on affiche les resultats dans un element de liste en ajoutant </span>
                                                <span style="color: #666666; font-style: italic;">// la fonction fill sur l'evenenement onClick</span>
		         			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li onClick=&quot;fill(\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$pays</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\');&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$pays</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	         		        <span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Il y a une probleme avec la requete sql.'</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span> 
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Il ne devrait pas avoir un accès direct à ce script !!!'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Tutoriel basé sur celui du blog nodstrum : <a href="http://nodstrum.com/2007/09/19/autocompleter/">http://nodstrum.com/2007/09/19/autocompleter/</a></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/04/28/tutorial-suggestions-auto-completion-en-ajax-avec-jquery-et-php/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Aides-mémoires pour la création de site web (couleurs, css, php, JQuery&#8230;)</title>
		<link>http://blog.arnaud-k.fr/2009/04/27/aides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery/</link>
		<comments>http://blog.arnaud-k.fr/2009/04/27/aides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:20:28 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[news du web]]></category>
		<category><![CDATA[aide-mémoire]]></category>
		<category><![CDATA[couleurs]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=377</guid>
		<description><![CDATA[Pour commencer la semaine, une belle liste de mementos pour tout ce qui concerne la création de site internet : Les couleurs web Aide-mémoire html Mémento CSS Aide-mémoire PHP Aide-mémoire en JQuery (que j&#8217;ai personnellement imprimé et scotché à mon&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/04/27/aides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F27%2Faides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F27%2Faides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-378" title="jquery aide memoire" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/jquery-aide-memoire.png" alt="jquery aide memoire" width="600" height="200" />Pour commencer la semaine, une belle liste de mementos pour tout ce qui concerne la création de site internet :</p>
<ul>
<li><a href="http://www.visibone.com/color/hexagon_800.gif">Les couleurs web<br />
</a><a href="http://www.visibone.com/color/hexagon_800.gif"><img class="alignnone size-full wp-image-379" style="margin-bottom:20px;" title="memento couleurs web" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/aide-couleurs.png" alt="memento couleurs web" width="150" height="150" /></a></li>
<li><a href="http://training.snd.org/2009/web-design/syllabus/HTML-sheet.pdf">Aide-mémoire html</a><br />
<a href="http://training.snd.org/2009/web-design/syllabus/HTML-sheet.pdf"><img class="alignnone size-full wp-image-381" style="margin-bottom:20px;" title="aide-html" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/aide-html.png" alt="aide-html" width="150" height="150" /><br />
</a></li>
<li><a href="http://training.snd.org/2009/web-design/syllabus/HTML-sheet.pdf">Mémento CSS</a><br />
<a href="http://training.snd.org/2009/web-design/syllabus/HTML-sheet.pdf"><img class="alignnone size-full wp-image-383" style="margin-bottom:20px;" title="Mémento CSS" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/aide-css1.png" alt="Mémento CSS" width="150" height="150" /><br />
</a></li>
<li><a href="http://www.emezeta.com/weblog/emezeta-php-card-v0.2.png">Aide-mémoire PHP</a><br />
<img class="alignnone size-full wp-image-384" style="margin-bottom:20px;" title="aide-mémoire en php" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/aide-php.png" alt="aide-mémoire en php" width="150" height="150" /></li>
<li><a href="http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png">Aide-mémoire en JQuery</a> (que j&#8217;ai personnellement imprimé et scotché à mon bureau <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )<br />
<a href="http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png"><img class="alignnone size-full wp-image-385" style="margin-bottom:20px;" title="aide-mémoire jquery" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/aide-jquery.png" alt="aide-mémoire jquery" width="150" height="150" /></a></li>
</ul>
<p>Il y a là de quoi bien redécorer son bureau, il y en a de toutes les couleurs !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/04/27/aides-memoires-pour-la-creation-de-site-web-couleurs-css-php-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial : connexion en AJAX avec JQuery et PHP</title>
		<link>http://blog.arnaud-k.fr/2009/04/22/tutorial-connexion-en-ajax-avec-jquery-et-php/</link>
		<comments>http://blog.arnaud-k.fr/2009/04/22/tutorial-connexion-en-ajax-avec-jquery-et-php/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 12:12:54 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[formulaire de connexion]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=310</guid>
		<description><![CDATA[Pour ce premier tutorial AJAX, je propose un simple formulaire de connexion sans rafraichissement de la page. Ca permettra également d&#8217;introduire un peu de php sur le blog. Il est possible d&#8217;essayer une démo (login : test, mot de passe&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/04/22/tutorial-connexion-en-ajax-avec-jquery-et-php/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F22%2Ftutorial-connexion-en-ajax-avec-jquery-et-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F04%2F22%2Ftutorial-connexion-en-ajax-avec-jquery-et-php%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>
Pour ce premier tutorial AJAX, je propose un simple f<strong>ormulaire de connexion sans rafraichissement de la page</strong>. Ca permettra également d&#8217;introduire un peu de php sur le blog.
</p>
<p><img src="http://blog.arnaud-k.fr/wp-content/uploads/2009/04/connexion-ajax.png" alt="connexion en ajax avec JQuery et PHP" title="connexion en ajax avec JQuery et PHP" width="600" height="200" class="alignnone size-full wp-image-311" /></p>
<p>
<strong>Il est possible d&#8217;<a href="http://blog.arnaud-k.fr/connexionAjax/">essayer une démo</a> (login : test, mot de passe : ajax) ou de <a href="http://blog.arnaud-k.fr/connexionAjax/connexionAjax.zip">télécharger la source</a> de cette démo</strong> (fichier php et mise en forme css inclus). Tout le code affiché ici sera du code dépouillé de tout mise en forme.
</p>
<p>
Pour commencer, on va <strong>préparer le formulaire HTML</strong> servant à la connexion. Deux champs sont nécessaires : nom d&#8217;utilsateur et mot de passe. Il ne faut pas oublier de donner un id (ici &laquo;&nbsp;connexionForm&nbsp;&raquo;) au formulaire pour la gestion des évènements avec JQuery. J&#8217;ai également ajouté un <strong>span vide qui contiendra éventuellement un message d&#8217;erreur</strong> si le login ou le mot de passe n&#8217;est pas bon.
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;connexionForm&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;connexionForm&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- début du formulaire de connexion --&gt;</span>   
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;erreur&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- span qui contiendra les éventuels messages d'erreur --&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login&quot;</span>&gt;</span>Nom d'utilisateur :<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- champ pour le login --&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pass&quot;</span>&gt;</span>Mot de passe :<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pass&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pass&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- champ pour le mot de passe --&gt;</span>
&nbsp;
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Je me connecte&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bouton&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- bouton de connexion --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- fin du formulaire --&gt;</span></pre></td></tr></table></div>

<p>
On passe ensuite à la partie JQuery. On commence par charger le framework dans le fichier html (entre les balises &lt;head&gt; et &lt;/head&gt;).
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>
A nous de jouer maintenant. <strong>L&#8217;appel en Ajax ne se fera qu&#8217;à la soumission du formulaire</strong> (avec l&#8217;événement &laquo;&nbsp;submit()&nbsp;&raquo;, ligne 2).
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#connexionForm&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	<span style="color: #006600; font-style: italic;">// à la soumission du formulaire						 </span>
		$.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// fonction permettant de faire de l'ajax</span>
		   type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// methode de transmission des données au fichier php</span>
		   url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;login.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// url du fichier php</span>
		   data<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;login=&quot;</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#login&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&amp;pass=&quot;</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#pass&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// données à transmettre</span>
		   success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// si l'appel a bien fonctionné</span>
				<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>msg<span style="color: #339933;">==</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// si la connexion en php a fonctionnée</span>
				<span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#connexion&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span id=<span style="color: #000099; font-weight: bold;">\&quot;</span>confirmMsg<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Vous &amp;ecirc;tes maintenant connect&amp;eacute;.&lt;/span&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #006600; font-style: italic;">// on désactive l'affichage du formulaire et on affiche un message de bienvenue à la place</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #006600; font-style: italic;">// si la connexion en php n'a pas fonctionnée</span>
				<span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span#erreur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>bomb.png<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>float:left;<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&amp;nbsp;Erreur lors de la connexion, veuillez v&amp;eacute;rifier votre login et votre mot de passe.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #006600; font-style: italic;">// on affiche un message d'erreur dans le span prévu à cet effet</span>
				<span style="color: #009900;">&#125;</span>
		   <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// permet de rester sur la même page à la soumission du formulaire</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
Enfin, il ne reste plus qu&#8217;à <strong>créer le fichier php (login.php)</strong> permettant de tester les paramètres de connexion en testant dans la base de données des membres, si le login et le mot de passe correspondent (ce code est ultra-simplifié, il n&#8217;est pas forcément très sécurisé <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). <strong>Si la connexion est validée, on créé un cookie</strong> (que l&#8217;on pourra tester par la suite avec la fonction &laquo;&nbsp;isset($_COOKIE[id])&nbsp;&raquo; ).<br />
Contenu du fichier login.php :
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// connexion avec la base de données</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Impossible de se connecter : &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;nomDeMaBase&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// on exécute maintenant la requete sql pour tester si les parametres de connexion sont ok</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT login, pass, id FROM membres WHERE login = '<span style="color: #006699; font-weight: bold;">$_POST[login]</span>' AND pass = '<span style="color: #006699; font-weight: bold;">$_POST[pass]</span>'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$membre</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span>login<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #000088;">$membre</span><span style="color: #009900;">&#91;</span>login<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span>pass<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #000088;">$membre</span><span style="color: #009900;">&#91;</span>pass<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">setcookie</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$membre</span><span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// genere un cookie contenant l'id du membre</span>
	<span style="color: #990000;">setcookie</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;login&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$membre</span><span style="color: #009900;">&#91;</span>login<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// genere un cookie contenant le login du membre		</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on 'retourne' la valeur 1 au javascript si la connexion est bonne</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// on 'retourne' la valeur 0 au javascript si la connexion n'est pas bonne</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>
C&#8217;est tout pour le premier tutorial AJAX/JQuery/PHP. Cela permet <strong>un premier contact avec AJAX</strong> qui peut être facilement mis en place grâce à JQuery (on économise beaucoup de lignes de codes par rapport au &laquo;&nbsp;JavaScript normal&nbsp;&raquo;&#8230;).</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/04/22/tutorial-connexion-en-ajax-avec-jquery-et-php/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>En cours de développement</title>
		<link>http://blog.arnaud-k.fr/2009/03/27/en-cours-de-developpement/</link>
		<comments>http://blog.arnaud-k.fr/2009/03/27/en-cours-de-developpement/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 17:20:21 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[développement web]]></category>
		<category><![CDATA[filmothèque en ligne]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=14</guid>
		<description><![CDATA[Dans les tuyaux depuis deux semaines, la création d&#8217;un site permettant de gérer sa filmothèque en ligne. Sur phpMyMovies (nom totalement provisoire, je suis pas super fan de ce nom&#8230;) tu pourras créer ta filmothèque, ajouter des films simplement (avec&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/03/27/en-cours-de-developpement/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F03%2F27%2Fen-cours-de-developpement%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F03%2F27%2Fen-cours-de-developpement%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: left;">Dans les tuyaux depuis deux semaines, la création d&#8217;un site permettant de gérer sa filmothèque en ligne. Sur phpMyMovies (nom totalement provisoire, je suis pas super fan de ce nom&#8230;) tu pourras créer ta filmothèque, ajouter des films simplement (avec les champs pré-remplis grâce à une belle base de données de films), gérer ta filmothèque (options de classements et tris), partager ta filmthèque avec la création d&#8217;une page publique pour chaque membre et voir les suggestions en fonction de tes gouts!</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-15" title="gestion de filmothèques en lign" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/03/phpmm.jpg" alt="gestion de filmothèques en lign" width="600" height="200" /></p>
<p style="text-align: left;">Tout ça n&#8217;en est qu&#8217;au tout début, j&#8217;ai fait une première maquette (dont tu as un aperçu ci-dessus) et commencé parallèlement le développement (connexion, ajout de film, auto-complétion). J&#8217;espère pouvoir proposer une première version (de test) en ligne bientôt.</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/03/27/en-cours-de-developpement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

