<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Saving State For Collapsible Drag Drop Panels</title>
	<atom:link href="http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/</link>
	<description>The Ultimate Web Developer&#039;s Resource</description>
	<lastBuildDate>Wed, 27 Jan 2010 15:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: jun</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-6053</link>
		<dc:creator>jun</dc:creator>
		<pubDate>Tue, 08 Dec 2009 07:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-6053</guid>
		<description>I like this post, but link demo Download the source code is not work.
U can update Permalink this.
Thank you.</description>
		<content:encoded><![CDATA[<p>I like this post, but link demo Download the source code is not work.<br />
U can update Permalink this.<br />
Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LP</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5703</link>
		<dc:creator>LP</dc:creator>
		<pubDate>Sat, 21 Nov 2009 11:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5703</guid>
		<description>It doesn&#039;t work for me... :(

The saving procedure doesn&#039;t update the database :(</description>
		<content:encoded><![CDATA[<p>It doesn&#8217;t work for me&#8230; <img src='http://webdeveloperplus.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The saving procedure doesn&#8217;t update the database <img src='http://webdeveloperplus.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LP</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5673</link>
		<dc:creator>LP</dc:creator>
		<pubDate>Fri, 20 Nov 2009 18:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5673</guid>
		<description>hmm... After reviewing all comments I have a hard time figuring out what to do and change. I have the same problem as many with the procedure of updating the database with new positions... Is it possible to update the tutorial and / or the source files so this issue wound be questioned again? 

Really great function btw :)</description>
		<content:encoded><![CDATA[<p>hmm&#8230; After reviewing all comments I have a hard time figuring out what to do and change. I have the same problem as many with the procedure of updating the database with new positions&#8230; Is it possible to update the tutorial and / or the source files so this issue wound be questioned again? </p>
<p>Really great function btw <img src='http://webdeveloperplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swetha</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5662</link>
		<dc:creator>Swetha</dc:creator>
		<pubDate>Fri, 20 Nov 2009 08:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5662</guid>
		<description>@hrabizadeh
Just wanted to help you with your problem. A previous visitor/user was kind enough to post the answer to the problem that you have experienced. It was posted by Frank on November 4, 2009 at 3:02 PM. I am pasting the code below, but the actual credit goes to Frank. I am simply citing it here for your easy reference:

///////Change the code in updatepanels.php page:

if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map(’stripslashes_deep’, $value) :
stripslashes($value);
return $value; }
$_POST = array_map(’stripslashes_deep’, $_POST);
$_GET = array_map(’stripslashes_deep’, $_GET);
$_COOKIE = array_map(’stripslashes_deep’, $_COOKIE);
$_REQUEST = array_map(’stripslashes_deep’, $_REQUEST);
}
$data=json_decode($_POST[&#039;data&#039;]);

Hope that helps you. Let us know.
Regards.</description>
		<content:encoded><![CDATA[<p>@hrabizadeh<br />
Just wanted to help you with your problem. A previous visitor/user was kind enough to post the answer to the problem that you have experienced. It was posted by Frank on November 4, 2009 at 3:02 PM. I am pasting the code below, but the actual credit goes to Frank. I am simply citing it here for your easy reference:</p>
<p>///////Change the code in updatepanels.php page:</p>
<p>if (get_magic_quotes_gpc()) {<br />
function stripslashes_deep($value) {<br />
$value = is_array($value) ? array_map(’stripslashes_deep’, $value) :<br />
stripslashes($value);<br />
return $value; }<br />
$_POST = array_map(’stripslashes_deep’, $_POST);<br />
$_GET = array_map(’stripslashes_deep’, $_GET);<br />
$_COOKIE = array_map(’stripslashes_deep’, $_COOKIE);<br />
$_REQUEST = array_map(’stripslashes_deep’, $_REQUEST);<br />
}<br />
$data=json_decode($_POST['data']);</p>
<p>Hope that helps you. Let us know.<br />
Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordie</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5647</link>
		<dc:creator>Jordie</dc:creator>
		<pubDate>Wed, 18 Nov 2009 23:59:22 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5647</guid>
		<description>Feel free to fix the spacing/newlines up in my previous comment, didn&#039;t seem to come through nicely.</description>
		<content:encoded><![CDATA[<p>Feel free to fix the spacing/newlines up in my previous comment, didn&#8217;t seem to come through nicely.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordie</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5646</link>
		<dc:creator>Jordie</dc:creator>
		<pubDate>Wed, 18 Nov 2009 23:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5646</guid>
		<description>You should really be escaping those values before entering them into an SQL query or you&#039;re risking an SQL injection attack.

&lt;code&gt;$item-&gt;order = mysql_real_escape_string($item-&gt;order);
$item-&gt;collapsed = mysql_real_escape_string($item-&gt;collapsed);&lt;/code&gt;

But seeing as they&#039;re numbers, it&#039;s better to cast them to integers:

&lt;code&gt;$item-&gt;order = (int)$item-&gt;order;
$item-&gt;collapsed = (int)$item-&gt;collapsed;&lt;/code&gt;

$col_id and $widget_id should be OK, but your preg_replace is still letting spaces through for some reason? Your database fields are integer fields.

Probably best to cast them to integers as well:

&lt;code&gt;$col_id = (int)$item-&gt;column; 
$widget_id = (int)$item-&gt;id; &lt;/code&gt;

Final code should look something like:

&lt;code&gt;foreach($data-&gt;items as $item)  
{
	$item-&gt;column = (int)$item-&gt;column;
	$item-&gt;id = (int)$item-&gt;id;
	$item-&gt;order = (int)$item-&gt;order;
	$item-&gt;collapsed = (int)$item-&gt;collapsed;
	
	$sql=&quot;UPDATE widgets SET column_id=&#039;&quot;.$item-&gt;column.&quot;&#039;, sort_no=&#039;&quot;.$item-&gt;order.&quot;&#039;, collapsed=&#039;&quot;.$item-&gt;collapsed.&quot;&#039; WHERE id=&#039;&quot;.$item-&gt;id.&quot;&#039;&quot;;
	mysql_query($sql) or die(&#039;Error updating widget DB&#039;);
}&lt;/code&gt;


Cheers. =)</description>
		<content:encoded><![CDATA[<p>You should really be escaping those values before entering them into an SQL query or you&#8217;re risking an SQL injection attack.</p>
<p><code>$item-&gt;order = mysql_real_escape_string($item-&gt;order);<br />
$item-&gt;collapsed = mysql_real_escape_string($item-&gt;collapsed);</code></p>
<p>But seeing as they&#8217;re numbers, it&#8217;s better to cast them to integers:</p>
<p><code>$item-&gt;order = (int)$item-&gt;order;<br />
$item-&gt;collapsed = (int)$item-&gt;collapsed;</code></p>
<p>$col_id and $widget_id should be OK, but your preg_replace is still letting spaces through for some reason? Your database fields are integer fields.</p>
<p>Probably best to cast them to integers as well:</p>
<p><code>$col_id = (int)$item-&gt;column;<br />
$widget_id = (int)$item-&gt;id; </code></p>
<p>Final code should look something like:</p>
<p><code>foreach($data-&gt;items as $item)<br />
{<br />
	$item-&gt;column = (int)$item-&gt;column;<br />
	$item-&gt;id = (int)$item-&gt;id;<br />
	$item-&gt;order = (int)$item-&gt;order;<br />
	$item-&gt;collapsed = (int)$item-&gt;collapsed;</p>
<p>	$sql="UPDATE widgets SET column_id='".$item-&gt;column."', sort_no='".$item-&gt;order."', collapsed='".$item-&gt;collapsed."' WHERE id='".$item-&gt;id."'";<br />
	mysql_query($sql) or die('Error updating widget DB');<br />
}</code></p>
<p>Cheers. =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5569</link>
		<dc:creator>kumar</dc:creator>
		<pubDate>Thu, 12 Nov 2009 15:23:42 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5569</guid>
		<description>I have download the zip file and change config

i inserted table which you given like,But i am getting the record display only, i am not getting the drag and drop like google,is there anything else i can update in that file

thanks
kumar</description>
		<content:encoded><![CDATA[<p>I have download the zip file and change config</p>
<p>i inserted table which you given like,But i am getting the record display only, i am not getting the drag and drop like google,is there anything else i can update in that file</p>
<p>thanks<br />
kumar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ARCHER</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5254</link>
		<dc:creator>ARCHER</dc:creator>
		<pubDate>Fri, 06 Nov 2009 00:23:11 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5254</guid>
		<description>Great work!
Any chance someone pack this as a wp plug-in?
Pleaseee! :))))</description>
		<content:encoded><![CDATA[<p>Great work!<br />
Any chance someone pack this as a wp plug-in?<br />
Pleaseee! <img src='http://webdeveloperplus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5164</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Wed, 04 Nov 2009 09:32:22 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5164</guid>
		<description>I have the solution check this.

Your magic_quotes_gpc = on so you have to change code.
The code you have to change in updatepanels.php :

if (get_magic_quotes_gpc()) {    
function stripslashes_deep($value)    {       
	 $value = is_array($value) ?   array_map(&#039;stripslashes_deep&#039;, $value) :                    
	 stripslashes($value);        
	 	return $value;    }   
		 $_POST = array_map(&#039;stripslashes_deep&#039;, $_POST);    
		 $_GET = array_map(&#039;stripslashes_deep&#039;, $_GET);    
		 $_COOKIE = array_map(&#039;stripslashes_deep&#039;, $_COOKIE);    
		 $_REQUEST = array_map(&#039;stripslashes_deep&#039;, $_REQUEST);
		}
$data=json_decode($_POST[&#039;data&#039;]);</description>
		<content:encoded><![CDATA[<p>I have the solution check this.</p>
<p>Your magic_quotes_gpc = on so you have to change code.<br />
The code you have to change in updatepanels.php :</p>
<p>if (get_magic_quotes_gpc()) {<br />
function stripslashes_deep($value)    {<br />
	 $value = is_array($value) ?   array_map(&#8216;stripslashes_deep&#8217;, $value) :<br />
	 stripslashes($value);<br />
	 	return $value;    }<br />
		 $_POST = array_map(&#8216;stripslashes_deep&#8217;, $_POST);<br />
		 $_GET = array_map(&#8216;stripslashes_deep&#8217;, $_GET);<br />
		 $_COOKIE = array_map(&#8216;stripslashes_deep&#8217;, $_COOKIE);<br />
		 $_REQUEST = array_map(&#8216;stripslashes_deep&#8217;, $_REQUEST);<br />
		}<br />
$data=json_decode($_POST['data']);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hrabizadeh</title>
		<link>http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/#comment-5120</link>
		<dc:creator>hrabizadeh</dc:creator>
		<pubDate>Tue, 03 Nov 2009 17:08:31 +0000</pubDate>
		<guid isPermaLink="false">http://webdeveloperplus.com/?p=417#comment-5120</guid>
		<description>Hi ، I am a asp.net developer but when found your beautiful code I decided to Install PHP and test this code .
after installing the PHP and download your code and run the SQL code every thing work very good but when I changed the box position in the page and Refresh the page , page didn&#039;t update.
I think you must check the updatePanels.php page !!


best regard</description>
		<content:encoded><![CDATA[<p>Hi ، I am a asp.net developer but when found your beautiful code I decided to Install PHP and test this code .<br />
after installing the PHP and download your code and run the SQL code every thing work very good but when I changed the box position in the page and Refresh the page , page didn&#8217;t update.<br />
I think you must check the updatePanels.php page !!</p>
<p>best regard</p>
]]></content:encoded>
	</item>
</channel>
</rss>
