<?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>SaCaWeb</title>
	<atom:link href="http://www.sacaweb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sacaweb.com</link>
	<description>il Blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:44:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&#8220;Attenzione! &#8211; Operazione di spostamento file fallita&#8221; in Joomla 1.5</title>
		<link>http://www.sacaweb.com/php-mysql/attenzione-operazione-di-spostamento-file-fallita-in-joomla-1-5/</link>
		<comments>http://www.sacaweb.com/php-mysql/attenzione-operazione-di-spostamento-file-fallita-in-joomla-1-5/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 15:43:47 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[installazione moduli]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[permessi files]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=249</guid>
		<description><![CDATA[Se dovesse malauguratamente comparire il messaggio in oggetto, magari mentre si prova ad installare un componente, un modulo oppure un template, provate ad effettuare i seguenti passi: &#8211; Nell&#8217;area di amministrazione di Joomla 1.5, cliccare su Aiuto>Info sistema; &#8211; Nella voce permessi cartelle, controllare che tutti i file siano scrivibili, in caso contrario, modificare i]]></description>
			<content:encoded><![CDATA[<p>Se dovesse malauguratamente comparire il messaggio in oggetto, magari mentre si prova ad installare un componente, un modulo oppure un template, provate ad effettuare i seguenti passi:<br />
	 &#8211; Nell&#8217;area di amministrazione di Joomla 1.5, cliccare su Aiuto>Info sistema;<br />
         &#8211; Nella voce permessi cartelle, controllare che tutti i file siano scrivibili, in caso contrario, modificare i permessi con un editor ftp.<br />
Attenzione che i percorsi delle cartelle tmp e logs devono essere specificati e possibilmente con path assoluto.</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fphp-mysql%2Fattenzione-operazione-di-spostamento-file-fallita-in-joomla-1-5%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/php-mysql/attenzione-operazione-di-spostamento-file-fallita-in-joomla-1-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lettere maiuscole accentate in php utf8</title>
		<link>http://www.sacaweb.com/php-mysql/lettere-maiuscole-accentate-in-php-utf8/</link>
		<comments>http://www.sacaweb.com/php-mysql/lettere-maiuscole-accentate-in-php-utf8/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 12:16:10 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[lettere maiuscole]]></category>
		<category><![CDATA[maiuscolo]]></category>
		<category><![CDATA[strtoupper]]></category>
		<category><![CDATA[uppercase utf8]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=236</guid>
		<description><![CDATA[Può capitare di voler trasformare in php una frase in maiuscolo e che questa contenga dei caratteri accentati. Premessa : i caratteri DEVONO essere codificati in utf8. Ho visto in giro per il web una miriade di funzioni che sostituiscono tutti i possibili caratteri accentati, sia con l&#8217;uso delle regexp sia con str_replace&#8230;non serve nulla]]></description>
			<content:encoded><![CDATA[<p>Può capitare di voler trasformare in php una frase in maiuscolo e che questa contenga dei caratteri accentati.<br />
Premessa : i caratteri DEVONO essere codificati in utf8.<br />
Ho visto in giro per il web una miriade di funzioni che sostituiscono tutti i possibili caratteri accentati, sia con l&#8217;uso delle regexp sia con str_replace&#8230;non serve nulla di tutto ciò.<br />
Ci viene in aiuto una funzione php :</p>
<p><em>string mb_strtoupper ( string $str [, string $encoding] )</em></p>
<p>ritorna una stringa con tutti i caratteri convertiti in maiuscolo e codificati in $encoding .</p>
<p>ad esempio:</p>
<p>$str = &#8220;àèìòù&#8221;;<br />
echo mb_strtoupper($str ,&#8221;UTF-8&#8243;);  // ÀÈÌÒÙ</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fphp-mysql%2Flettere-maiuscole-accentate-in-php-utf8%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/php-mysql/lettere-maiuscole-accentate-in-php-utf8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anti spam: nascondere indirizzo email</title>
		<link>http://www.sacaweb.com/strumenti-utili/anti-spam-nascondere-indirizzo-email/</link>
		<comments>http://www.sacaweb.com/strumenti-utili/anti-spam-nascondere-indirizzo-email/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 13:41:49 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Strumenti utili]]></category>
		<category><![CDATA[antispam]]></category>
		<category><![CDATA[email obfuscator]]></category>
		<category><![CDATA[nascondere email]]></category>
		<category><![CDATA[obfuscator]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=180</guid>
		<description><![CDATA[Email obfuscator Email da nascondere: Nome opzionale da visualizzare nel link: Link nascosto: Anteprima nel browser:]]></description>
			<content:encoded><![CDATA[<h3>Email obfuscator</h3>
<form name="obf_email_frm" id="obf_email_frm" method="post" action="">
Email da nascondere:</p>
<input type="email" name="e" id="e" value="" placeholder="info@miosito.it" size="50" required />
<p>Nome opzionale da visualizzare nel link:</p>
<input type="text" name="n" id="n" value="" size="50" />
<p>Link nascosto:<br />
<textarea id="link_obf" name="link_obf" style="width: 370px; height: 150px;border:1px solid #ccc;" title='Copia e incolla questo testo nel codice html della tua pagina web'></textarea><br />
Anteprima nel browser: <a href=''></a></p>
<input type="submit" id="invia" name="invia" value="Invia" />
</p></form>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fstrumenti-utili%2Fanti-spam-nascondere-indirizzo-email%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/strumenti-utili/anti-spam-nascondere-indirizzo-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Popolare una select con javascript, jQuery, Ajax, php</title>
		<link>http://www.sacaweb.com/javascript-jquery-ajax/popolare-una-select-con-javascript-jquery-ajax-php/</link>
		<comments>http://www.sacaweb.com/javascript-jquery-ajax/popolare-una-select-con-javascript-jquery-ajax-php/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 23:43:51 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Javascript/JQuery/Ajax]]></category>
		<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[popolare select]]></category>
		<category><![CDATA[popolare select dinamicamente]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=168</guid>
		<description><![CDATA[Al giorno d&#8217;oggi il web è pieno zeppo di pagine che, grazie a richieste asincrone (ajax), aggiornano porzioni di esse senza effettuare un caricamento di tutta la pagina. Un &#34;problema&#34; ricorrente è popolare una select in base alla scelta effettuata in un&#8217;altra select. Un esempio è quello delle regioni e città: si seleziona una regione]]></description>
			<content:encoded><![CDATA[<p>Al giorno d&#8217;oggi il web è pieno zeppo di pagine che, grazie a richieste asincrone (ajax), aggiornano porzioni di esse senza effettuare un caricamento di tutta la pagina.</p>
<p>Un &quot;problema&quot; ricorrente è popolare una select in base alla scelta effettuata in un&#8217;altra select. Un esempio è quello delle regioni e città: si seleziona una regione dalla prima select e tramite ajax si popola la seconda select con le sole città della regione scelta. Ma ci sono migliaia di esempi e casi d&#8217;uso.</p>
<p><a href="http://www.sacaweb.com/blog/blogspot4/" target="_blank">Guarda Demo</a></p>
<p>Vediamo come sia semplice realizzare tutto con l&#8217;aiuto di jQuery.</p>
<p>Come esempio base ci basta un file html che contiene le select ed un file php al quale viene inoltrata la richiesta asincrona e che ci restituisce i dati in base ai parametri passati.</p>
<p>Nella sezione head del file html:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-1.5.2.min.js&quot;</span><span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> charset<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;utf-8&quot;</span><span style="color: #339933;">&gt;</span>
    $<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;select#primaselect&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</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: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;select.php&quot;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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>dati<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> dati.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				options <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'&lt;option value=&quot;'</span> <span style="color: #339933;">+</span> dati<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">valore</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span> dati<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">etichetta</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/option&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#secondaselect&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#secondaselect option:first'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'selected'</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>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Nel body del file html:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">b</span>&gt;</span>Scegli il tuo smartphone preferito:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">b</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;primaselect&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span>Scegli<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span>&gt;</span>HTC<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span>&gt;</span>SAMSUNG<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3&quot;</span>&gt;</span>MOTOROLA<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;secondaselect&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span></pre></td></tr></table></div>

<p>Contenuto del file 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
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
  <span style="color: #000088;">$dati</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_001&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Desire HD&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_002&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Flyer&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_003&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Chacha&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_004&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;HD2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_005&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Galaxi S&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_006&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Wave II&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_007&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Omnia 7&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_008&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Omnia HD&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_009&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Atrix 4G&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_010&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Droid Bionic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_011&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Cliq 2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;valore&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;cod_012&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;etichetta&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Bravo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #b1b100;">echo</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dati</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>In questo caso il file php recupera i dati da alcuni array costruiti ad hoc per l&#8217;esempio, ma nulla vieta (anzi si spera) che i dati siano recuperati da un db.</p>
<p>Per qualsiasi chiarimento, a disposizione.</p>
<p><a href="http://www.sacaweb.com/blog/blogspot4/" target="_blank">Guarda demo</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fjavascript-jquery-ajax%2Fpopolare-una-select-con-javascript-jquery-ajax-php%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/javascript-jquery-ajax/popolare-una-select-con-javascript-jquery-ajax-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Riscrivere url dinamicamente con jQuery</title>
		<link>http://www.sacaweb.com/javascript-jquery-ajax/riscrivere-url-dinamicamente-con-jquery/</link>
		<comments>http://www.sacaweb.com/javascript-jquery-ajax/riscrivere-url-dinamicamente-con-jquery/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 22:32:51 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Javascript/JQuery/Ajax]]></category>
		<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jquery history]]></category>
		<category><![CDATA[riscrivere url dinamicamente]]></category>
		<category><![CDATA[window.location.hash]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=153</guid>
		<description><![CDATA[Com&#8217;è noto, Ajax permette di effettuare richieste asincrone ad un web server via Javascript, senza ricaricare la pagina e senza cambiare url nella barra degli indirizzi. Le richieste asincrone effettuate con Ajax hanno spesso lo scopo di modificare parti della pagina html. Effettuando varie richieste consecutive, ci si può trovare innanzi ad una pagina completamente]]></description>
			<content:encoded><![CDATA[<p>Com&#8217;è noto, Ajax permette di effettuare richieste asincrone ad un web server via Javascript, senza ricaricare la pagina e senza cambiare url nella barra degli indirizzi.</p>
<p>Le richieste asincrone effettuate con Ajax hanno spesso lo scopo di modificare parti della pagina html. Effettuando varie richieste consecutive, ci si può trovare innanzi ad una pagina completamente diversa da quella iniziale, ma con uno stesso url nella barra degli indirizzi!</p>
<p>Esempio: Il sito <em>www.sitodiannunci.it</em>, alla pagina <em>annunci.php</em> permette di navigare tra gli annunci di una categoria mediante due pulsanti <em>avanti </em>e <em>indietro</em>. Il contenuto della pagina <em>annunci.php</em> cambia, mostrando i dati relativi al nuovo annuncio caricati via Ajax.</p>
<p>Dopo varie pressioni dei pulsanti <em>avanti </em>e <em>indietro</em>, l&#8217;utente decide di salvare la pagina tra i preferiti perchè interessato all&#8217;annuncio. Cosa succede? Viene salvata la stringa <em>www.sitodiannunci.it/annunci.php</em>, ma da questa non si riesce a&nbsp; risalire all&#8217;annuncio di interesse. E&#8217; chiaro che servirebbe una variabile da aggiungere alla <em>query string</em> che identifichi univocamente un annuncio, tipo <em>www.sitodiannunci.it/annunci.php?id=123</em>.</p>
<p>Se si modifica l&#8217;url della pagina ad ogni annuncio con un linguaggio lato server tipo php, si ottiene il ricaricamento della pagina che non è un effetto voluto (altrimenti perchè stiamo usando Ajax?). Stesso risultato se modifichiamo la proprietà <em>window.location.href</em>&nbsp; via javascript.&nbsp; Allora come risolvere???</p>
<p>Ci viene in aiuto una proprietà poco conosciuta&nbsp; dell&#8217;oggetto <em>location </em>javascript: <em>window.location<strong>.hash</strong>.</em></p>
<p>La stringa contenuta in <em>window.location.hash</em> sarà aggiunta in coda all&#8217;url della pagina, preceduta dal simbolo cancelletto <strong>#</strong> , senza ricaricare la pagina, ad esempio&nbsp; <em>www.sitoannunci.it/annunci.php<strong>#123 </strong></em></p>
<p>Salvando nei preferiti&nbsp; <em>www.sitoannunci.it/annunci.php<strong>#123 </strong></em><span style="font-style: italic;">&nbsp; la proprietà</span> <em>window.location.hash </em>conterrà la stringa 123 che può servire a risalire all&#8217;annuncio di interesse.</p>
<p>Abbiamo visto come risalire al contenuto di un annuncio&nbsp; impostando e poi leggendo la proprietà javascript <em>window.location.hash</em> .</p>
<p>E non è tutto. Si poteva mai parlare di javascript senza nominare jQuery??? Certo che no. Esiste infatti un plugin,<strong><em> jquery.history</em></strong>, che rende tutto semplicissimo.</p>
<p>jQuery history plugin aiuta a supportare i pulsanti avanti/indietro ed il bookmarks nelle applicazioni javascript. Permette di salvare lo stato nell&#8217;url hash e di ripristinarlo.</p>
<p><a href="http://www.sacaweb.com/blog/blogpost3/index.html" target="_blank">live demo</a>&nbsp;&nbsp;&nbsp; ( consultare il codice sorgente )</p>
<p>Ci sono 2 metodi per interagire con l&#8217;oggetto jQuery.history:</p>
<h3>jQuery.history.init(callback [, options])</h3>
<p>Inizializza il plugin e va richiamato una volta quando la pagina è completamente caricata.</p>
<p>&nbsp;</p>
<h3>jQuery.history.load(hash)</h3>
<p>Carica una stringa in <code>location.hash</code>,crea una nuova entry nella storia della navigazione e invoca la funzione di callback se necessario.&nbsp; A meno che&nbsp; l&#8217;hash passato come parametro sia diverso da quello corrente, la funzione di callback non è invocata.</p>
<p>
	<a href="http://tkyk.github.com/jquery-history-plugin/#documentation" target="_blank">Documentazione completa (in inglese)</a></p>
<p>&nbsp;</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fjavascript-jquery-ajax%2Friscrivere-url-dinamicamente-con-jquery%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/javascript-jquery-ajax/riscrivere-url-dinamicamente-con-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Vertical Scroller Plus Plugin</title>
		<link>http://www.sacaweb.com/javascript-jquery-ajax/jquery-vertical-scroller-plus-plugin/</link>
		<comments>http://www.sacaweb.com/javascript-jquery-ajax/jquery-vertical-scroller-plus-plugin/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 23:21:49 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Javascript/JQuery/Ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[scroller]]></category>
		<category><![CDATA[scrolling]]></category>
		<category><![CDATA[vertical scroller]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=142</guid>
		<description><![CDATA[Ho scritto questo plugin jQuery che trasforma un div contenitore(wrapper) che contiene un div figlio(scroller) in un riquadro con contenuto scorrevole verticalmente usando due pulsanti su e giù. Guarda la demo live Testato e funzionante anche su dispositivi mobili touch screen iphone e Android ! Il contenuto del div scroller può essere qualsiasi elemento html]]></description>
			<content:encoded><![CDATA[<p>Ho scritto questo plugin jQuery che trasforma un div contenitore(wrapper) che contiene un div figlio(scroller) in un riquadro con contenuto scorrevole verticalmente usando due pulsanti su e giù.</p>
<p><a href="http://www.sacaweb.com/blog/blogpost2/vertical_scroller_plus.html" target="_blank">Guarda la demo live</a></p>
<p>Testato e funzionante anche su dispositivi mobili touch screen iphone e Android !</p>
<p>Il contenuto del div scroller può essere qualsiasi elemento html (anche solo una tabella, a differenza di altri plugin! <img src='http://www.sacaweb.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  )</p>
<p>Il plugin calcola automaticamente l&#8217;altezza del div scroller.</p>
<p>Si possono utilizzare più istanze di scroller nella stessa pagina <strong>cambiando semplicemente gli id del div wrapper, del div scroller e dei pulsanti.</strong></p>
<p>Si può impostare di quanti pixel deve scorrere il contenuto e la velocità di scorrimento.</p>
<p>Facilissimo da usare:</p>
<ul>
<li>basta creare due div, uno dentro l&#8217;altro;</li>
<li>il div esterno sarà il contenitore;</li>
<li>il div interno sarà lo scroller;</li>
<li>due pulsanti per scorrere su e giù;</li>
<li>tutti gli elementi inseriti all&#8217;interno del div scroller scorreranno alla pressione dei pulsanti.</li>
</ul>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</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> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width:350px;height:120px;&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;scroller&quot;</span>&gt;</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>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;su_btn&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;su&quot;</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;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;giu_btn&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;giù&quot;</span> <span style="color: #66cc66;">/</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>Includere i files jQuery e applicare il plugin al div contenitore:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>7
8
9
10
11
12
13
14
</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://code.jquery.com/jquery-1.5.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.verticalscrollplus-1.0.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;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;JavaScript&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
  $(document).ready(function(){
      $(&quot;#wrapper&quot;).verticalScrollPlus({step:100});
      $(&quot;#wrapper2&quot;).verticalScrollPlus({speed: 1500, step: 50, upID: &quot;#su_btn2&quot;, downID: &quot;#giu_btn2&quot;, scrollerID:&quot;#scroller2&quot; });
  });
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<div style='color:white;text-shadow: 1px 1px 1px #000;font:bold 14px Arial;background-color:#b4e11e;padding:5px;border:1px solid red;border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; '>
<p>Se reputi che il jQuery Vertical Scroller Plus Plugin ti sia stato utile, pensa ad una libera donazione come incentivo allo sviluppo futuro. Ti ringrazio anticipatamente.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="NA3XVUZN2YUUY">
<input type="image" src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - Il sistema di pagamento online più facile e sicuro!">
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1"><br />
</form>
</div>
<p>Il plugin può essere scaricato da:</p>
<p><a href="http://plugins.jquery.com/content/verticalscrollerplus-10" target="_blank">http://plugins.jquery.com/content/verticalscrollerplus-10</a></p>
<p>Plugin options:</p>
<ul>
<li><em><strong>speed</strong> : quanto è veloce l&#8217;animazione di scorrimento verticale;(default = 500)</em></li>
<li><em><strong>step</strong>: di quanti pixel scorre il contenuto ad ogni pressione di tasto su oppure giù;(default = 60)</em></li>
<li><em><strong>upID</strong>: id dell&#8217;elemento che fa partire l&#8217;animazione verso su;(default = #su_btn)</em></li>
<li><em><strong>downID</strong>: id dell&#8217;elemento che fa partire l&#8217;animazione verso giù;(default = #giu_btn)</em></li>
<li><em><strong>scrollerID</strong>: id dell&#8217;elemento il cui contenuto scorrerà verticalmente;(default = #scroller)</em></li>
</ul>
<p></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fjavascript-jquery-ajax%2Fjquery-vertical-scroller-plus-plugin%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/javascript-jquery-ajax/jquery-vertical-scroller-plus-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Etichetta di caricamento Ajax tipo Google</title>
		<link>http://www.sacaweb.com/javascript-jquery-ajax/etichetta-di-caricamento-ajax-tipo-google/</link>
		<comments>http://www.sacaweb.com/javascript-jquery-ajax/etichetta-di-caricamento-ajax-tipo-google/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 21:07:55 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Javascript/JQuery/Ajax]]></category>
		<category><![CDATA[Ajax Loading Google Like]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=91</guid>
		<description><![CDATA[Oggi vediamo un modo per realizzare un avviso di loading Ajax tipo Google. Mi riferisco alla&#160; etichetta di loading che compare in alto nella pagina&#160; ogni qualvolta eseguiamo un&#8217;azione tipo eliminare un messaggio (che evidentemente effettua richieste Ajax) all&#8217;interno ad esempio di GMail. Con l&#8217;aiuto di JQuery diventa tutto semplicissimo. Vedi la demo live. Di]]></description>
			<content:encoded><![CDATA[<p>Oggi vediamo un modo per realizzare un avviso di loading Ajax tipo Google.</p>
<p>Mi riferisco alla&nbsp; etichetta di loading che compare in alto nella pagina&nbsp; ogni qualvolta eseguiamo un&#8217;azione tipo eliminare un messaggio (che evidentemente effettua richieste Ajax) all&#8217;interno ad esempio di GMail.</p>
<p>Con l&#8217;aiuto di JQuery diventa tutto semplicissimo. <a href="blog/blogpost1/loading_google_like.html" target="_blank">Vedi la demo live.</a></p>
<p>Di seguito la parte più importante del codice javascript:<br />
	&nbsp;</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
</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>
&nbsp;
         <span style="color: #009966; font-style: italic;">/* quando si preme il pulsante si carica il contenuto da un file di testo  */</span>
         $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#loadingbtn'</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: #009900;">&#40;</span><span style="color: #3366CC;">'#contenuto'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'file.txt'</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>
&nbsp;
         <span style="color: #006600; font-style: italic;">/* quando parte la richiesta Ajax mostra il div di loading, quando la richiesta
            viene completata nasconde il div  */</span>
         $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#loading'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ajaxSend</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</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: #660066;">ajaxComplete</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</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>
&nbsp;
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p>Di seguito il codice html della pagina:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</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>Clicca sul pulsante per caricare via Ajax del contenuto nel div sotto<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&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;button&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loadingbtn&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loadingbtn&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Carica contenuto&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&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;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contenuto&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contenuto&quot;</span>&gt;&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;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loading&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loading&quot;</span>&gt;</span>Loading...<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>Importante la regola css che imposta lo stato iniziale dell&#8217;avviso di loading su invisibile, in quanto è su questa che va ad agire javascript al verificarsi degli eventi ajaxSend e ajaxComplete.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#loading</span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fjavascript-jquery-ajax%2Fetichetta-di-caricamento-ajax-tipo-google%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/javascript-jquery-ajax/etichetta-di-caricamento-ajax-tipo-google/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Selezionare radiobox da jQuery</title>
		<link>http://www.sacaweb.com/javascript-jquery-ajax/selezionare-radiobox-da-jquery/</link>
		<comments>http://www.sacaweb.com/javascript-jquery-ajax/selezionare-radiobox-da-jquery/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 00:18:28 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Javascript/JQuery/Ajax]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=66</guid>
		<description><![CDATA[Quando selezioniamo un componente radiobox col mouse succedono almeno due cose: Il pallino del radiobox viene annerito ad indicare che &#232; selezionato; Viene lanciato un evento javascript di tipo onchange, che volendo pu&#242; essere intercettato. Supponiamo di avere un gruppo di radiobox che rappresentano colori: &#60;input name=&#34;colori&#34; type=&#34;radio&#34; value=&#34;red&#34; /&#62; Rosso &#60;input name=&#34;colori&#34; type=&#34;radio&#34; value=&#34;green&#34;]]></description>
			<content:encoded><![CDATA[<p>Quando selezioniamo un componente radiobox col mouse succedono almeno due cose:</p>
<ol>
<li>Il pallino del radiobox viene annerito ad indicare che &egrave; selezionato;</li>
<li>Viene lanciato un evento javascript di tipo onchange, che volendo pu&ograve; essere intercettato.</li>
</ol>
<p>Supponiamo di avere un gruppo di radiobox che rappresentano colori:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;colori&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;red&quot;</span> <span style="color: #339933;">/&gt;</span> Rosso 
<span style="color: #339933;">&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;colori&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;green&quot;</span> <span style="color: #339933;">/&gt;</span> Verde 
<span style="color: #339933;">&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;colori&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;blue&quot;</span> <span style="color: #339933;">/&gt;</span> Blu
&nbsp;
<span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;risposta&quot;</span><span style="color: #339933;">&gt;&lt;/</span>span<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Grazie alla potenza di jQuery &egrave; semplice intercettare l&#39;evento onchange quando si seleziona un radiobox:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[name=colori]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</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;#risposta&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#risposta&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</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></div></div>

<p>Quando si seleziona un radiobox, il corrispondente colore viene scritto in un elemento span con id=&quot;risposta&quot;. Da notare anche come sia semplice modificare lo stile di un elemento.</p>
<p>Ma come si potrebbe simulare il click del mouse da jQuery?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> colore <span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>colore <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=&quot;</span><span style="color: #339933;">+</span>colore<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Attraverso il metodo attr(), risulta semplice modificare l&#39;attributo checked del radiobox.</p>
<p>Sembrerebbe bastare, ma la modifica dell&#39;attributo checked attraverso il metodo attr() ottiene come risultato la sola selezione del radiobox, senza lanciare alcun evento onchange.</p>
<p>Dando il valore &#8220;red&#8221; alla variabile colore, si ottiene la selezione del radiobox corrispondente, ma non viene scritto nulla nell&#39;elemento con id=&#8221;risposta&#8221;. Questo perch&egrave; attraverso la sola modifica dell&#39;attributo col metodo attr() non viene lanciato l&#39;evento onchange.</p>
<p>Si pu&ograve; per&ograve; lanciare l&#39;evento onchange manualmente attraverso il codice</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=&quot;</span><span style="color: #339933;">+</span>colore<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Il codice finale &egrave;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;input name=&quot;colori&quot; type=&quot;radio&quot; value=&quot;red&quot; /&gt;Rosso
&lt;input name=&quot;colori&quot; type=&quot;radio&quot; value=&quot;green&quot; /&gt;Verde
&lt;input name=&quot;colori&quot; type=&quot;radio&quot; value=&quot;blue&quot; /&gt;Blu
&nbsp;
&lt;span id=&quot;risposta&quot;&gt;&lt;/span&gt;
&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> colore <span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>colore <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=&quot;</span><span style="color: #339933;">+</span>colore<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</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><span style="color: #3366CC;">&quot;input[name=colori]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</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;#risposta&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#risposta&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</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>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=&quot;</span><span style="color: #339933;">+</span>colore<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]:radio&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><a class="fancybox-iframe" href="http://www.sacaweb.com/blog/prova_radiobox.html">Guarda il risultato</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fjavascript-jquery-ajax%2Fselezionare-radiobox-da-jquery%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/javascript-jquery-ajax/selezionare-radiobox-da-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL:Massimo tra due colonne di due tabelle</title>
		<link>http://www.sacaweb.com/php-mysql/mysqlmassimo-tra-due-colonne-di-due-tabelle/</link>
		<comments>http://www.sacaweb.com/php-mysql/mysqlmassimo-tra-due-colonne-di-due-tabelle/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 20:22:03 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[LIMIT]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ORDER BY]]></category>
		<category><![CDATA[SELECT]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[UNION]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/?p=42</guid>
		<description><![CDATA[Prendiamo in considerazione due tabelle di esempio in un db MySQL: tabella 1 id nome stipendio 1 Andrea 1200 2 Francesco 1300 tabella 2 id nome stipendio 1 Antonio 1250 2 Gianluca 1350 Per un motivo qualsiasi ci servirebbe conoscere lo stipendio in assoluto più alto, cioè il più alto valore del campo stipendio relativamente]]></description>
			<content:encoded><![CDATA[<p>Prendiamo in considerazione due tabelle di esempio in un db MySQL:</p>
<div style="width:450px;height:130px;margin:0 auto;">
<table style="float:left" cellspacing="0" cellpadding="0" border="1" width="200">
<caption>tabella 1</caption>
<tr>
<th>id</th>
<th>nome</th>
<th>stipendio</th>
</tr>
<tr>
<td>1</td>
<td>Andrea</td>
<td>1200</td>
</tr>
<tr>
<td>2</td>
<td>Francesco</td>
<td>1300</td>
</tr>
</table>
<table style="float:right" cellspacing="0" cellpadding="0" border="1" width="200">
<caption>tabella 2</caption>
<tr>
<th>id</th>
<th>nome</th>
<th>stipendio</th>
</tr>
<tr>
<td>1</td>
<td>Antonio</td>
<td>1250</td>
</tr>
<tr>
<td>2</td>
<td>Gianluca</td>
<td>1350</td>
</tr>
</table>
</div>
<p>Per un motivo qualsiasi ci servirebbe conoscere lo stipendio in assoluto più alto, cioè il più alto valore del campo stipendio relativamente alle due tabelle.</p>
<p>Una soluzione rapida, anche se poco elegante è la seguente:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> max<span style="color: #66cc66;">&#40;</span>stipendio<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> massimo
<span style="color: #993333; font-weight: bold;">FROM</span> tabella1
&nbsp;
<span style="color: #993333; font-weight: bold;">UNION</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> max<span style="color: #66cc66;">&#40;</span>stipendio<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> massimo
<span style="color: #993333; font-weight: bold;">FROM</span> tabella2
&nbsp;
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> massimo <span style="color: #993333; font-weight: bold;">DESC</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span></pre></div></div>

<p>Il risultato è:</p>
<table cellspacing="0" cellpadding="0" border="1" width="100">
<tr>
<th>massimo</th>
</tr>
<tr>
<td>1350</td>
</tr>
</table>
<p>Molto utile l&#8217;operatore UNION che unisce gli insiemi restituiti dalle due interrogazioni  SELECT in uno solo.</p>
<p>Da notare la presenza delle  clausole ORDER BY e  LIMIT; la prima ordina i risultati dal più grande al più piccolo e la seconda limita questi risultati ad uno solo che poi è il più grande. Senza queste due clausole il risultato sarebbe stato :</p>
<table cellspacing="0" cellpadding="0" border="1" width="100">
<tr>
<th>massimo</th>
</tr>
<tr>
<td>1300</td>
</tr>
<tr>
<td>1350</td>
</tr>
</table>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fphp-mysql%2Fmysqlmassimo-tra-due-colonne-di-due-tabelle%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/php-mysql/mysqlmassimo-tra-due-colonne-di-due-tabelle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amministrazione Virtuemart da Joomla Frontend</title>
		<link>http://www.sacaweb.com/php-mysql/amministrazione-virtuemart-da-joomla-frontend/</link>
		<comments>http://www.sacaweb.com/php-mysql/amministrazione-virtuemart-da-joomla-frontend/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 20:58:27 +0000</pubDate>
		<dc:creator>sacaweb</dc:creator>
				<category><![CDATA[Php/MySQL]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[pshop_mode]]></category>
		<category><![CDATA[virtuemart]]></category>

		<guid isPermaLink="false">http://www.sacaweb.com/blog/?p=25</guid>
		<description><![CDATA[Scenario : sito web ecommerce con Joomla e Virtuemart. Capita di voler permettere l&#8217;accesso all&#8217;amministrazione di Virtuemart senza passare dalla solita Login raggiungibile all&#8217;indirizzo url www.tuosito.it/administrator , ma direttamente dal componente Login del Frontend di Joomla. Nel caso in cui si dovessero verificare dei problemi di visualizzazione, quelle seguenti potrebbero essere delle soluzioni: Accedere tramite]]></description>
			<content:encoded><![CDATA[<p>Scenario : sito web ecommerce con Joomla e Virtuemart.</p>
<p>Capita di voler permettere l&#8217;accesso all&#8217;amministrazione di Virtuemart senza passare dalla solita Login raggiungibile all&#8217;indirizzo url</p>
<pre> www.tuosito.it/administrator</pre>
<p>,  ma direttamente dal componente Login del Frontend di Joomla.</p>
<p>Nel caso in cui si dovessero verificare dei problemi di visualizzazione, quelle seguenti potrebbero essere delle soluzioni:</p>
<ul>
<li>Accedere tramite ftp allo spazio web che ospita il sito ed abilitare permessi di esecuzione (755) al file

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.tuosito.it/components/com_virtuemart/fetchscript.php</span></pre></div></div>

<p>questo si occupa di includere alcuni file javascript e fogli di stile necessari alla corretta visualizzazione.</li>
<li>Per amministrare Virtuemart da Joomla frontend modificare il file

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.tuosito.it/administrator/components/com_virtuemart/html/product.product_list.php</span></pre></div></div>

<p>alla linea 287:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;?page=<span style="color: #006699; font-weight: bold;">$modulename</span>.product_form&amp;amp;limitstart=<span style="color: #006699; font-weight: bold;">$limitstart</span>&amp;amp;keyword=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$keyword</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;amp;product_id=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">f</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;product_id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;amp;product_parent_id=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$product_parent_id</span><span style="color: #339933;">;</span></pre></div></div>

<p>aggiungendo all&#8217;inizio dell&#8217;url &#8216;<code><strong>pshop_mode=admin</strong></code>&#8216; diventa:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;?pshop_mode=admin&amp;amp;page=<span style="color: #006699; font-weight: bold;">$modulename</span> . product_form&amp;amp;limitstart=<span style="color: #006699; font-weight: bold;">$limitstart</span>&amp;amp;keyword=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$keyword</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;amp;product_id=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">f</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;product_id&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;amp;product_parent_id=&quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$product_parent_id</span><span style="color: #339933;">;</span></pre></div></div>

<p>Questo evita che l&#8217;interfaccia di amministrazione di Virtuemart compaia all&#8217;interno di una pagina di Joomla nell&#8217;area del contenuto, lasciando visibili anche l&#8217;header con eventuali menu.</li>
</ul>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.sacaweb.com%2Fphp-mysql%2Famministrazione-virtuemart-da-joomla-frontend%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.sacaweb.com/php-mysql/amministrazione-virtuemart-da-joomla-frontend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

