<?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[Problema pulsante]]></title><description><![CDATA[<p dir="auto">Ho un problemino, quando clicco su "Add to cart" non va avanti, come se ci fosse un # invece dell'url. Nello script originale funziona. Metto il codice:</p>
<pre><code>&lt;script language="javascript"&gt;
function addtocart(pid){
document.form1.productid.value=pid;
document.form1.command.value='add';
document.form1.submit();
}
&lt;/script&gt;
&lt;/head&gt;


&lt;body&gt;
&lt;? include('template/includes/pagepeel.inc.php'); ?&gt;
&lt;? include('template/includes/login.inc.php'); ?&gt;
&lt;? include('template/includes/menu.inc.php'); ?&gt; 
&lt;? include('template/includes/header.inc.php'); ?&gt;
&lt;? include('template/includes/blocco.inc.php'); ?&gt;

&lt;div class="cleared"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
&lt;form name="form1"&gt;
&lt;input type="hidden" name="productid" /&gt;
&lt;input type="hidden" name="command" /&gt;
&lt;/form&gt;
&lt;?
$result = mysql_query("SELECT * FROM products") or die(mysql_error()); 
while($row=mysql_fetch_array($result)){
?&gt;
&lt;tbody&gt;
&lt;tr class="even"&gt;
&lt;td style="width:97px;"&gt;&lt;?=$row['name']?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?=$row['description']?&gt;&lt;/td&gt;
&lt;td style="text-align:center;width:77px;"&gt;
&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
&lt;tbody&gt;
&lt;tr class="even"&gt;
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Dini&lt;/td&gt;
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;Update&lt;/td&gt;
&lt;td style="border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;img width="14" height="14" alt="" src="/template/images/success-icon.png" style="border-top-width:0;border-right-width:0;border-bottom-width:0;border-left-width:0;margin:2px;" /&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
**
&lt;br /&gt;
&lt;/td&gt;
&lt;td style="text-align:center;"&gt;
&lt;table class="newlife-article" border="0" cellspacing="0" cellpadding="0" style="width:100%;"&gt;
&lt;tbody&gt;
&lt;tr class="even"&gt;
&lt;td style="text-align:center;width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;span style="text-align:center;"&gt;&lt;span style="font-weight:bold;"&gt;? &lt;?=$row['price']?&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="width:97px;border-top-width:3px;border-right-width:3px;border-bottom-width:3px;border-left-width:3px;"&gt;&lt;input type="button" value="Add to Cart" onclick="addtocart(&lt;?=$row['serial']?&gt;)" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;span style="color:#008800"&gt;&lt;?=$row['scadenza']?&gt;&lt;/span&gt;	
&lt;/td&gt;
&lt;/tr&gt;
&lt;? } ?&gt;
</code></pre>
<p dir="auto">File originale:</p>
<pre><code>&lt;?
	include("includes/db.php");
	include("includes/functions.php");
	
	if($_REQUEST['command']=='add' &amp;&amp; $_REQUEST['productid']&gt;0){
		$pid=$_REQUEST['productid'];
		addtocart($pid,1);
		header("location:shoppingcart.php");
		exit();
	}
?&gt;

&lt;head&gt;
&lt;meta  http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Products&lt;/title&gt;
&lt;script language="javascript"&gt;
	function addtocart(pid){
		document.form1.productid.value=pid;
		document.form1.command.value='add';
		document.form1.submit();
	}
&lt;/script&gt;
&lt;/head&gt;


&lt;body&gt;
&lt;form name="form1"&gt;
	&lt;input type="hidden" name="productid" /&gt;
    &lt;input type="hidden" name="command" /&gt;
&lt;/form&gt;
&lt;div align="center"&gt;
	&lt;h1 align="center"&gt;Products&lt;/h1&gt;
	&lt;table border="0" cellpadding="2px" width="600px"&gt;
		&lt;?
			$result=mysql_query("select * from products");
			while($row=mysql_fetch_array($result)){
		?&gt;
    	&lt;tr&gt;
        	&lt;td&gt;&lt;img src="&lt;?=$row['picture']?&gt;" /&gt;&lt;/td&gt;
            &lt;td&gt;   	&lt;b&gt;&lt;?=$row['name']?&gt;&lt;/b&gt;&lt;br /&gt;
            		&lt;?=$row['description']?&gt;&lt;br /&gt;
                    Price:&lt;big style="color:green"&gt;
                    	$&lt;?=$row['price']?&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;
                    &lt;input type="button" value="Add to Cart" onclick="addtocart(&lt;?=$row['serial']?&gt;)" /&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
        &lt;tr&gt;&lt;td colspan="2"&gt;&lt;hr size="1" /&gt;&lt;/td&gt;
        &lt;? } ?&gt;
    &lt;/table&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/167791/problema-pulsante</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 16:11:58 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/167791.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Mar 2012 20:13:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problema pulsante on Thu, 15 Mar 2012 08:40:59 GMT]]></title><description><![CDATA[<p dir="auto">Quali sono quindi le differenze fra il file originale ed il tuo modificato?<br />
Se uno funziona e l'altro no allora la causa va ricercata sulle tue modifiche.</p>
]]></description><link>https://dev.connect.gt/post/1058264</link><guid isPermaLink="true">https://dev.connect.gt/post/1058264</guid><dc:creator><![CDATA[cyrus]]></dc:creator><pubDate>Thu, 15 Mar 2012 08:40:59 GMT</pubDate></item><item><title><![CDATA[Reply to Problema pulsante on Wed, 14 Mar 2012 20:16:45 GMT]]></title><description><![CDATA[<p dir="auto">Quelle righe ci sono, solo che per sbaglio non le ho inserite nel topic ma nel file ci sono</p>
]]></description><link>https://dev.connect.gt/post/1058275</link><guid isPermaLink="true">https://dev.connect.gt/post/1058275</guid><dc:creator><![CDATA[heron]]></dc:creator><pubDate>Wed, 14 Mar 2012 20:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to Problema pulsante on Wed, 14 Mar 2012 12:25:33 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, forse perchè non gli dici dove deve andare ...</p>
<p dir="auto">... ti serve qualche riga di codice come nel tuo file originale del tipo</p>
<pre><code class="language-php">	if($_REQUEST['command']=='add' &amp;&amp; $_REQUEST['productid']&gt;0){
		$pid=$_REQUEST['productid'];
		addtocart($pid,1);
		header("location:shoppingcart.php");
		exit();
</code></pre>
]]></description><link>https://dev.connect.gt/post/1058262</link><guid isPermaLink="true">https://dev.connect.gt/post/1058262</guid><dc:creator><![CDATA[cyrus]]></dc:creator><pubDate>Wed, 14 Mar 2012 12:25:33 GMT</pubDate></item><item><title><![CDATA[Reply to Problema pulsante on Tue, 13 Mar 2012 12:51:57 GMT]]></title><description><![CDATA[<p dir="auto">Pare che il tag &lt;form&gt; manchi di alcuni attributi importanti quali action, method. Aggiungendo questi 2 dovresti risolvere qualcosa. Anche se tranne qualche warning sembra funzionare, uso un file molto semplificato. Dovresti indicare qualche segnalazione in piu.</p>
]]></description><link>https://dev.connect.gt/post/1058261</link><guid isPermaLink="true">https://dev.connect.gt/post/1058261</guid><dc:creator><![CDATA[linoma]]></dc:creator><pubDate>Tue, 13 Mar 2012 12:51:57 GMT</pubDate></item></channel></rss>