<?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 for Coders Cult Web Development Blog</title>
	<atom:link href="http://coderscult.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://coderscult.com</link>
	<description>Website development - HTML/XHTML, CSS, Javascript/AJAX, PHP, MySQL</description>
	<lastBuildDate>Tue, 16 Feb 2010 04:02:15 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on PHP cURL Cookies Example by Mike Lopez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-212</link>
		<dc:creator>Mike Lopez</dc:creator>
		<pubDate>Tue, 16 Feb 2010 04:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-212</guid>
		<description>Yup, that&#039;d be a good idea.</description>
		<content:encoded><![CDATA[<p>Yup, that&#8217;d be a good idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Robert Gonzalez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-211</link>
		<dc:creator>Robert Gonzalez</dc:creator>
		<pubDate>Mon, 15 Feb 2010 18:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-211</guid>
		<description>Shouldn&#039;t you unlink() the tempfile so as not to have a bunch of unused files laying around in your file system?</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t you unlink() the tempfile so as not to have a bunch of unused files laying around in your file system?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Mike Lopez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-210</link>
		<dc:creator>Mike Lopez</dc:creator>
		<pubDate>Mon, 15 Feb 2010 04:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-210</guid>
		<description>1. Yes.  The first request sets the cookie.
2. Not sure, but I think it does it automatically.</description>
		<content:encoded><![CDATA[<p>1. Yes.  The first request sets the cookie.<br />
2. Not sure, but I think it does it automatically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Hany B</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-209</link>
		<dc:creator>Hany B</dc:creator>
		<pubDate>Sat, 13 Feb 2010 00:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-209</guid>
		<description>Thanks a lot for this, great simple tutorial that i will be testing right away!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this, great simple tutorial that i will be testing right away!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Paul</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-208</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 10 Feb 2010 14:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-208</guid>
		<description>1. Is it nessesary to do two requests?

2. Can curl automaticaly remove expired cookies form file ?</description>
		<content:encoded><![CDATA[<p>1. Is it nessesary to do two requests?</p>
<p>2. Can curl automaticaly remove expired cookies form file ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by xQmail.eu</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-109</link>
		<dc:creator>xQmail.eu</dc:creator>
		<pubDate>Wed, 16 Dec 2009 19:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-109</guid>
		<description>Great tutorial, simple and to the point, thanks!</description>
		<content:encoded><![CDATA[<p>Great tutorial, simple and to the point, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Yogesh</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-106</link>
		<dc:creator>Yogesh</dc:creator>
		<pubDate>Tue, 24 Nov 2009 10:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-106</guid>
		<description>Object Moved error in above cookies example for my url through</description>
		<content:encoded><![CDATA[<p>Object Moved error in above cookies example for my url through</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Sleep Function by therealdealsince1982</title>
		<link>http://coderscult.com/javascript-ajax/2009/02/05/javascript-sleep-function/comment-page-1/#comment-105</link>
		<dc:creator>therealdealsince1982</dc:creator>
		<pubDate>Tue, 10 Nov 2009 04:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=62#comment-105</guid>
		<description>I have searched/googled quite a few webpages on javascript sleep/wait... and there is NO answer if you want javascript to &quot;RUN, DELAY, RUN&quot;... what most people got was either, &quot;RUN, RUN(useless stuff), RUN&quot; or &quot;RUN, RUN + delayed RUN&quot;....

So I ate some burgers and got thinking:::
here is a solution that works... but you have to chop up your running codes...:::

replace &lt;.. with &lt; to run..
//.........................................
//example1:



DISPLAY


//javascript sleep by &quot;therealdealsince1982&quot;; copyrighted 2009
//setInterval
var i = 0;

function run() {
	//pieces of codes to run
	if (i==0){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ i +&quot; is ran&quot;; }
	if (i==1){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ i +&quot; is ran&quot;; }
	if (i==2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ i +&quot; is ran&quot;; }
	if (i &gt;2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ i +&quot; is ran&quot;; }
	if (i==5){document.getElementById(&quot;id1&quot;).innerHTML= &quot;all code segment finished running&quot;; clearInterval(t); } //end interval, stops run
	i++; //segment of code finished running, next...
}

t=setInterval(&quot;run()&quot;,1000);





//....................................
//example2:



DISPLAY


//javascript sleep by &quot;therealdealsince1982&quot;; copyrighted 2009
//setTimeout
var i = 0;

function flow() {
	run(i);
	i++; //code segment finished running, increment i; can put elsewhere
	sleep(1000);
	if (i==5) {clearTimeout(t);} //stops flow, must be after sleep()
}

function run(segment) {
	//pieces of codes to run, can use switch statement
	if (segment==0){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment==1){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment==2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment &gt;2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
}

function sleep(dur) {t=setTimeout(&quot;flow()&quot;,dur);} //starts flow control again after dur

flow(); //starts flow




//.....................................
//example3:



DISPLAY


//javascript sleep by &quot;therealdealsince1982&quot;; copyrighted 2009
//setTimeout, switch
var i = 0;

function flow() {
	switch(i)
	{
		case 0:
			run(i);
			sleep(1000);
			break;
		case 1:
			run(i);
			sleep(2000);
			break;
		case 5:
			run(i);
			clearTimeout(t); //stops flow
			break;
		default:
			run(i);
			sleep(3000);
			break;
	}
}

function run(segment) {
	//pieces of codes to run, can use switch statement
	if (segment==0){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment==1){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment==2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	if (segment &gt;2){document.getElementById(&quot;id1&quot;).innerHTML= &quot;code segment &quot;+ segment +&quot; is ran&quot;; }
	i++; //current segment of code finished running, next...
}

function sleep(dur) {t=setTimeout(&quot;flow()&quot;,dur);} //starts flow control again after dur

flow(); //starts flow control for first time...


</description>
		<content:encoded><![CDATA[<p>I have searched/googled quite a few webpages on javascript sleep/wait&#8230; and there is NO answer if you want javascript to &#8220;RUN, DELAY, RUN&#8221;&#8230; what most people got was either, &#8220;RUN, RUN(useless stuff), RUN&#8221; or &#8220;RUN, RUN + delayed RUN&#8221;&#8230;.</p>
<p>So I ate some burgers and got thinking:::<br />
here is a solution that works&#8230; but you have to chop up your running codes&#8230;:::</p>
<p>replace &lt;.. with &lt; to run..<br />
//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
//example1:</p>
<p>DISPLAY</p>
<p>//javascript sleep by &#8220;therealdealsince1982&#8243;; copyrighted 2009<br />
//setInterval<br />
var i = 0;</p>
<p>function run() {<br />
	//pieces of codes to run<br />
	if (i==0){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ i +&#8221; is ran&#8221;; }<br />
	if (i==1){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ i +&#8221; is ran&#8221;; }<br />
	if (i==2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ i +&#8221; is ran&#8221;; }<br />
	if (i &gt;2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ i +&#8221; is ran&#8221;; }<br />
	if (i==5){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;all code segment finished running&#8221;; clearInterval(t); } //end interval, stops run<br />
	i++; //segment of code finished running, next&#8230;<br />
}</p>
<p>t=setInterval(&#8221;run()&#8221;,1000);</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
//example2:</p>
<p>DISPLAY</p>
<p>//javascript sleep by &#8220;therealdealsince1982&#8243;; copyrighted 2009<br />
//setTimeout<br />
var i = 0;</p>
<p>function flow() {<br />
	run(i);<br />
	i++; //code segment finished running, increment i; can put elsewhere<br />
	sleep(1000);<br />
	if (i==5) {clearTimeout(t);} //stops flow, must be after sleep()<br />
}</p>
<p>function run(segment) {<br />
	//pieces of codes to run, can use switch statement<br />
	if (segment==0){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment==1){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment==2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment &gt;2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
}</p>
<p>function sleep(dur) {t=setTimeout(&#8221;flow()&#8221;,dur);} //starts flow control again after dur</p>
<p>flow(); //starts flow</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
//example3:</p>
<p>DISPLAY</p>
<p>//javascript sleep by &#8220;therealdealsince1982&#8243;; copyrighted 2009<br />
//setTimeout, switch<br />
var i = 0;</p>
<p>function flow() {<br />
	switch(i)<br />
	{<br />
		case 0:<br />
			run(i);<br />
			sleep(1000);<br />
			break;<br />
		case 1:<br />
			run(i);<br />
			sleep(2000);<br />
			break;<br />
		case 5:<br />
			run(i);<br />
			clearTimeout(t); //stops flow<br />
			break;<br />
		default:<br />
			run(i);<br />
			sleep(3000);<br />
			break;<br />
	}<br />
}</p>
<p>function run(segment) {<br />
	//pieces of codes to run, can use switch statement<br />
	if (segment==0){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment==1){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment==2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	if (segment &gt;2){document.getElementById(&#8221;id1&#8243;).innerHTML= &#8220;code segment &#8220;+ segment +&#8221; is ran&#8221;; }<br />
	i++; //current segment of code finished running, next&#8230;<br />
}</p>
<p>function sleep(dur) {t=setTimeout(&#8221;flow()&#8221;,dur);} //starts flow control again after dur</p>
<p>flow(); //starts flow control for first time&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP cURL Cookies Example by Feroz</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-104</link>
		<dc:creator>Feroz</dc:creator>
		<pubDate>Fri, 23 Oct 2009 10:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-104</guid>
		<description>hi,

File on another host... calling form http://localhost/test.php
----------------------------------------------------------------------------------------
$url =&quot;http://localhost/taiba/tfcsadmcp/index.php&quot;; 
$reffer = &#039;http://localhost/taiba/tfcsadmcp/index.php&#039;;
$cookie_file_path = getcwd().&quot;/tfcsadmcp/_files/cookie.txt&quot;;
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_AUTOREFERER, 0);
//curl_setopt($curl, CURLOPT_REFERER, $reffer);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER[&#039;HTTP_USER_AGENT&#039;]);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIE, session_name() . &#039;=&#039; . session_id());
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, &quot;username=admin&amp;password=323123&amp;pageaction=login&amp;&quot;);
$data = curl_exec ($curl);
$signupStr=getSignupString($data);

curl_setopt($curl, CURLOPT_URL,&quot;http://localhost/taiba/tfcsadmcp/index.php?component=cman&amp;page=wce.gall.php&quot;);//set this URL to wherever the form submits to
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($curl, CURLOPT_POST,1);//yes we want to post
curl_setopt($curl, CURLOPT_POSTFIELDS,$signupStr);//tell it where to find our sign up string
$data=curl_exec($curl);
curl_close($curl);//close the session

echo $data;

NOTE: But I can&#039;t access another pages after i login.. only the calling page i can access and the target web is using cookies and session.
Login is working prefect..</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>File on another host&#8230; calling form <a href="http://localhost/test.php" rel="nofollow">http://localhost/test.php</a><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
$url =&#8221;http://localhost/taiba/tfcsadmcp/index.php&#8221;;<br />
$reffer = &#8216;http://localhost/taiba/tfcsadmcp/index.php&#8217;;<br />
$cookie_file_path = getcwd().&#8221;/tfcsadmcp/_files/cookie.txt&#8221;;<br />
$curl = curl_init();<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);<br />
curl_setopt($curl, CURLOPT_HEADER, 0);<br />
curl_setopt($curl, CURLOPT_POST, 0);<br />
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);<br />
curl_setopt($curl, CURLOPT_AUTOREFERER, 0);<br />
//curl_setopt($curl, CURLOPT_REFERER, $reffer);<br />
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);<br />
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);<br />
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);<br />
curl_setopt($curl, CURLOPT_COOKIE, session_name() . &#8216;=&#8217; . session_id());<br />
curl_setopt($curl, CURLOPT_URL, $url);<br />
curl_setopt($curl, CURLOPT_POSTFIELDS, &#8220;username=admin&amp;password=323123&amp;pageaction=login&amp;&#8221;);<br />
$data = curl_exec ($curl);<br />
$signupStr=getSignupString($data);</p>
<p>curl_setopt($curl, CURLOPT_URL,&#8221;http://localhost/taiba/tfcsadmcp/index.php?component=cman&amp;page=wce.gall.php&#8221;);//set this URL to wherever the form submits to<br />
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_POST,1);//yes we want to post<br />
curl_setopt($curl, CURLOPT_POSTFIELDS,$signupStr);//tell it where to find our sign up string<br />
$data=curl_exec($curl);<br />
curl_close($curl);//close the session</p>
<p>echo $data;</p>
<p>NOTE: But I can&#8217;t access another pages after i login.. only the calling page i can access and the target web is using cookies and session.<br />
Login is working prefect..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Sleep Function by Al</title>
		<link>http://coderscult.com/javascript-ajax/2009/02/05/javascript-sleep-function/comment-page-1/#comment-103</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Thu, 22 Oct 2009 19:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=62#comment-103</guid>
		<description>This is a terrible implementation. The while loop will completely dominate the CPU and hang the browser until sleep is done. On Firefox, if you sleep for longer than 5 or 10 seconds, this will cause an ugly warning dialog because the browser will think the script is stuck in an infinite loop.

There is no JavaScript sleep() function. (Which I find to be a huge flaw with the langauge.) Instead, you should use setTimeout(). Google &quot;JavaScript sleep&quot; to find what other people have said on this topic, but a loop that polls the current time is NOT what you want.</description>
		<content:encoded><![CDATA[<p>This is a terrible implementation. The while loop will completely dominate the CPU and hang the browser until sleep is done. On Firefox, if you sleep for longer than 5 or 10 seconds, this will cause an ugly warning dialog because the browser will think the script is stuck in an infinite loop.</p>
<p>There is no JavaScript sleep() function. (Which I find to be a huge flaw with the langauge.) Instead, you should use setTimeout(). Google &#8220;JavaScript sleep&#8221; to find what other people have said on this topic, but a loop that polls the current time is NOT what you want.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
