<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CIao a tutti, mi presento e vi chiedo aiuto]]></title><description><![CDATA[<p dir="auto">Ciao a tutti, non posso credere di avere finalmente trovato un forum dove esporre problemi inerenti al php e al mysql in maniera esclusiva. SOno un laureando in lingue moderne per il web e come tesi sto preparando una applicazione mashup fra le Api di google MAP,e un database mysql.</p>
<p dir="auto">L'idea è avere un elenco di tutti i dipartimenti con relative coordinate, un campo form che invii la ricerca dell'utente ad una query che interroghi il db e in seguito l'exporting in xml. Ho gia fatto tutto... e la beta è pronta suil mio sito</p>
<p dir="auto">soltanto che il problema che mi ritrovo è il seguente.... l'informazione che dovrebbe passare al file php tramite il form ,che si occupa di creare la query, in realta non passa... quindi il database restituisce sempre tutti i valori....</p>
<p dir="auto">vi posto il codice del form, chiamato file index2.php</p>
<p dir="auto"><em>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a href="http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" rel="nofollow ugc">w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"&gt;</em><br />
<em>&lt;html xmlns=".w3.org/1999/xhtml"&gt;</em><br />
<em>&lt;head&gt;</em><br />
<em>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;</em><br />
<em>&lt;title&gt;Ricerca Dipartimeni Home&lt;/title&gt;</em><br />
<em>&lt;script src="<a href="http://maps.google.com/maps?file=api" rel="nofollow ugc">maps.google.com/maps?file=api</a>&amp;v=2&amp;key=ABQIAAAAewK-imDclgeHvzhRCVp_eBQPRgDiN0y-2FDuYD51Yt3cl0T-PRQOg1VnJEU0Ebz130m_-0CDK0ciJg" type="text/javascript"&gt;&lt;/script&gt;</em><br />
<em>&lt;script type="text/javascript"&gt;</em><br />
<em>//&lt;![CDATA[</em></p>
<pre><code>*function load()* 
*{*
	*if (GBrowserIsCompatible())* 
  	*{*
    	*// Crea mappa*
		*var map = new GMap2(document.getElementById("map"));*
    	
		*// Imposta centro su Palermo (LAT 38.12, LONG 13.36)*
		*map.setCenter(new GLatLng(38.12, 13.36), 12);*
		
		*// Visualizza controlli - TIPO MAPPA*
		*map.addControl(new GMapTypeControl());*
		
		*// Visualizza controlli - ZOOM GRANDE*
		*map.addControl(new GLargeMapControl());*

		*// Apre Popup :)*
		*map.openInfoWindow(map.getCenter(),*
               *document.createTextNode("Palermo!"));*
		
  	*}*
*}*

*//]]&gt;*
</code></pre>
<p dir="auto"><em>&lt;/script&gt;</em><br />
<em>&lt;/head&gt;</em><br />
<em>&lt;body onload="load()" onunload="GUnload()" style="font-family:Arial, Helvetica, sans-serif; font-size:13px; "&gt;</em><br />
<em>&lt;h3&gt;Ricerca dipartimenti -BETA- &lt;/h3&gt;</em></p>
<p dir="auto"><em>&lt;form method="post" action="result2.php"&gt;</em><br />
<em>&lt;p class="head"&gt;Search&lt;/p&gt;</em></p>
<p dir="auto"><em>&lt;input id="searchkeywords" type="text" name="keywords"</em></p>
<p dir="auto"><em>&gt;</em><br />
<em>&lt;input id="searchbutton" class="submit" type="submit"</em><br />
<em>value="Search"&gt;</em><br />
<em>&lt;/p&gt;</em><br />
<em>&lt;/form&gt;</em></p>
<p dir="auto"><em>&lt;div id="map" style="width: 468px; height: 360px"&gt;</em><br />
<em>&lt;/div&gt;</em><br />
<em>&lt;p&gt; &lt;/p&gt;</em><br />
<em>&lt;p&gt; &lt;/p&gt;</em><br />
<em>&lt;/body&gt;</em></p>
<p dir="auto"><em>&lt;/html&gt;</em></p>
<p dir="auto">e poi il file result2.php</p>
<p dir="auto"><em>&lt;?php</em><br />
<em>require("resource.php");</em></p>
<p dir="auto"><em>function parseToXML($htmlStr)</em><br />
<em>{</em><br />
<em>$xmlStr=str_replace('&lt;','&lt;',$htmlStr);</em><br />
<em>$xmlStr=str_replace('&gt;','&gt;',$xmlStr);</em><br />
<em>$xmlStr=str_replace('"','"',$xmlStr);</em><br />
<em>$xmlStr=str_replace("'",''',$xmlStr);</em><br />
<em>$xmlStr=str_replace("&amp;",'&amp;',$xmlStr);</em><br />
<em>return $xmlStr;</em><br />
<em>}</em></p>
<p dir="auto"><em>// Opens a connection to a mySQL server</em><br />
<em>$connection=mysql_connect ($db_host, $db_user, $db_password);</em><br />
<em>if (!$connection) {</em><br />
<em>die('Not connected : ' . mysql_error());</em><br />
<em>}</em></p>
<p dir="auto"><em>// Set the active mySQL database</em><br />
<em>$db_selected = mysql_select_db($db_database, $connection);</em><br />
<em>if (!$db_selected) {</em><br />
<em>die ('Can't use db : ' . mysql_error());</em><br />
<em>}</em></p>
<p dir="auto"><em>// Select all the rows in the markers table</em></p>
<p dir="auto"><em>$query= "SELECT * FROM markers WHERE ('address') like ('%$_POST[index2]%') ";</em><br />
<em>$result = mysql_query($query);</em><br />
<em>if (!$result) {</em><br />
<em>die('Invalid query: ' . mysql_error());</em><br />
<em>}</em></p>
<p dir="auto"><em>header("Content-type: text/xml");</em></p>
<p dir="auto"><em>// Start XML file, echo parent node</em><br />
<em>echo '&lt;markers&gt;';</em></p>
<p dir="auto"><em>// Iterate through the rows, printing XML nodes for each</em><br />
<em>while ($row = @mysql_fetch_assoc($result)){</em><br />
<em>// ADD TO XML DOCUMENT NODE</em><br />
<em>echo '&lt;marker ';</em><br />
<em>echo 'name="' . parseToXML('&amp;','&amp;', $row['name']) . '" ';</em><br />
<em>echo 'address="' . parseToXML($row['address']) . '" ';</em><br />
<em>echo 'lat="' . $row['lat'] . '" ';</em><br />
<em>echo 'lng="' . $row['lng'] . '" ';</em><br />
<em>echo 'type="' . $row['type'] . '" ';</em><br />
<em>echo '/&gt;';</em><br />
<em>}</em></p>
<p dir="auto"><em>// End XML file</em><br />
<em>echo '&lt;/markers&gt;';</em></p>
<p dir="auto"><em>?&gt;</em></p>
<p dir="auto">quindi in pratica mi trovo una mashup praticamente non funzionante.... ho provato di tutto ma per le mie compentenze questo è il massimo che riesco a produrre e cosi ,dopo tanto cercare, sono sbarcato qua nella speranza di trovare un aiuto.....</p>
<p dir="auto">vi ringrazio in anticipo</p>
]]></description><link>https://dev.connect.gt/topic/65157/ciao-a-tutti-mi-presento-e-vi-chiedo-aiuto</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 12:59:16 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/65157.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Mar 2008 20:39:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CIao a tutti, mi presento e vi chiedo aiuto on Mon, 03 Mar 2008 22:11:09 GMT]]></title><description><![CDATA[<p dir="auto">ho risolto...... sistemando un po i campi del form adesso la query restituisce l'informazione giusta..... purtroppo si è presentato un altro problema.... speravo che la pagina che ha il codice di google map si richiamasse automaticamente le coordinate giuste ma invece non lo fa quindi dovrei una volta che la query restituisce i valori in xml del luogo dovrei fare in modo di mandarli a alla mappa... qualche idea?</p>
]]></description><link>https://dev.connect.gt/post/690254</link><guid isPermaLink="true">https://dev.connect.gt/post/690254</guid><dc:creator><![CDATA[paolomis]]></dc:creator><pubDate>Mon, 03 Mar 2008 22:11:09 GMT</pubDate></item><item><title><![CDATA[Reply to CIao a tutti, mi presento e vi chiedo aiuto on Mon, 03 Mar 2008 21:18:03 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Samyorn, grazie per la celere risposta, ho fatto la modifica ma cosi non restituisce nulla, non esporta nessun xml. Credemi sto impazzendo con questa applicazione, sto quasi pentendomi di aver scelto questa come tesi di laurea....<br />
non so onestamente dove puo essere il problema, il db cmq funziona perche da phpmyadmin con query risponde corretamente.... il problema sembra sussistere tra il form e la query......</p>
]]></description><link>https://dev.connect.gt/post/690253</link><guid isPermaLink="true">https://dev.connect.gt/post/690253</guid><dc:creator><![CDATA[paolomis]]></dc:creator><pubDate>Mon, 03 Mar 2008 21:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to CIao a tutti, mi presento e vi chiedo aiuto on Mon, 03 Mar 2008 20:46:29 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Paolomis e benvenuto nel ForumGT <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=2190ae3dadd" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";)" alt="😉" /><br />
ho dato una sbirciata al tuo script credo che il problema stia quì:</p>
<pre><code class="language-php">$query= "SELECT * FROM markers WHERE ('address') like ('%$_POST[keywords]%') ";
</code></pre>
<p dir="auto">prova a modificarlo così e facci sapere se funziona <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=2190ae3dadd" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";)" alt="😉" /><br />
<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/54a3bffb-5e4a-4eb8-81dc-99b2072e5d05-175.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--ciauz" style="height:1.4em;width:auto;vertical-align:middle" title=":ciauz:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/690243</link><guid isPermaLink="true">https://dev.connect.gt/post/690243</guid><dc:creator><![CDATA[samyorn]]></dc:creator><pubDate>Mon, 03 Mar 2008 20:46:29 GMT</pubDate></item></channel></rss>