<?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: How to use Session Cookies in PHP</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/</link>
	<description></description>
	<lastBuildDate>Tue, 10 Jan 2012 01:21:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mircea</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-643461</link>
		<dc:creator>Mircea</dc:creator>
		<pubDate>Thu, 14 Jan 2010 11:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-643461</guid>
		<description>I have 2 scripts and i would like to have the same signup/login for for both. The signup/login would be only on the first script , the second one will have disabled the forms. 
So on the second one i just need them to appear as info where the case is. So when signup/login/edit i should have that info ( name, email, phone ) going to 2 databases. 
Any ideas how could i do that ?
Would sessions help me ?</description>
		<content:encoded><![CDATA[<p>I have 2 scripts and i would like to have the same signup/login for for both. The signup/login would be only on the first script , the second one will have disabled the forms.<br />
So on the second one i just need them to appear as info where the case is. So when signup/login/edit i should have that info ( name, email, phone ) going to 2 databases.<br />
Any ideas how could i do that ?<br />
Would sessions help me ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-608643</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Mon, 17 Nov 2008 20:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-608643</guid>
		<description>Mark, rather than using the foreach method, just use the simple array operation + which accomplishes the same &quot;overwrite duplicates&quot; goal.

$_SESSION[&#039;post&#039;] = $_POST + $_SESSION[&#039;post&#039;];</description>
		<content:encoded><![CDATA[<p>Mark, rather than using the foreach method, just use the simple array operation + which accomplishes the same &#034;overwrite duplicates&#034; goal.</p>
<p>$_SESSION['post'] = $_POST + $_SESSION['post'];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-548809</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 12 Feb 2008 13:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-548809</guid>
		<description>Will, I was having the same trouble as you, I guess you used Keith&#039;s faster version as well.  The problem with his method is that when you load the post data directly like that, you overwrite all the existing data.

If you use the original foreach method, you only overwrite duplicate field names, which is perfect for multipage forms.</description>
		<content:encoded><![CDATA[<p>Will, I was having the same trouble as you, I guess you used Keith&#039;s faster version as well.  The problem with his method is that when you load the post data directly like that, you overwrite all the existing data.</p>
<p>If you use the original foreach method, you only overwrite duplicate field names, which is perfect for multipage forms.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-521841</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Mon, 16 Jul 2007 04:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-521841</guid>
		<description>Radio buttons in a series will have the same name - but the one checked will be the one that defines the value... so in your case, you have two radio buttons set as
&lt;code&gt;name=&quot;contact&quot;&lt;/code&gt;
So after you do the trick to transfer all the POST to SESSION - you can check for values, etc. using:
&lt;code&gt;$_SESSION[&#039;post&#039;][&#039;contact&#039;]&lt;/code&gt;
For example:
&lt;code&gt; if ($_SESSION[&#039;post&#039;][&#039;contact&#039;] == &quot;whateverTheDefaultValueIs&quot;) {
.....etc....&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Radio buttons in a series will have the same name &#8211; but the one checked will be the one that defines the value&#8230; so in your case, you have two radio buttons set as<br />
<code>name="contact"</code><br />
So after you do the trick to transfer all the POST to SESSION &#8211; you can check for values, etc. using:<br />
<code>$_SESSION['post']['contact']</code><br />
For example:<br />
<code> if ($_SESSION['post']['contact'] == "whateverTheDefaultValueIs") {<br />
.....etc....</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-521803</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 15 Jul 2007 20:17:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-521803</guid>
		<description>This was very helpful.  But what about radio buttons, where you have a default checked value?  I&#039;d like to have the form remember if they&#039;re using the checked value, or whether they selected another value.  (You can see my form at http://www.meganhollingshead.com/contact.php.

Thanks.</description>
		<content:encoded><![CDATA[<p>This was very helpful.  But what about radio buttons, where you have a default checked value?  I&#039;d like to have the form remember if they&#039;re using the checked value, or whether they selected another value.  (You can see my form at <a href="http://www.meganhollingshead.com/contact.php" rel="nofollow">http://www.meganhollingshead.com/contact.php</a>.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: will</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-521308</link>
		<dc:creator>will</dc:creator>
		<pubDate>Tue, 10 Jul 2007 12:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-521308</guid>
		<description>Your method saves me a lot of time, as I am trying to convert a 600+ field form into a step-by-step process using PHP sessions.  How do you apply this to a multi-page form (like, 5 pages, for example)?  I can&#039;t get a form on the second page to append data to the session, then repeat that process for each step of the form.</description>
		<content:encoded><![CDATA[<p>Your method saves me a lot of time, as I am trying to convert a 600+ field form into a step-by-step process using PHP sessions.  How do you apply this to a multi-page form (like, 5 pages, for example)?  I can&#039;t get a form on the second page to append data to the session, then repeat that process for each step of the form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/comment-page-1/#comment-519490</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Thu, 21 Jun 2007 15:25:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2007/05/28/how-to-use-session-cookies-in-php/#comment-519490</guid>
		<description>There is a quicker way to transfer the $_POST info into $_SESSION

These are both just arrays .. so

Instead of:

&lt;code&gt;foreach($_POST as $k=&gt;$v) {
$_SESSION[&#039;post&#039;][$k]=$v;
}&lt;/code&gt;


You could use:

&lt;code&gt;$_SESSION[&#039;post&#039;] = $_POST;&lt;/code&gt;

Its less code, and not as processor intensive.</description>
		<content:encoded><![CDATA[<p>There is a quicker way to transfer the $_POST info into $_SESSION</p>
<p>These are both just arrays .. so</p>
<p>Instead of:</p>
<p><code>foreach($_POST as $k=&gt;$v) {<br />
$_SESSION['post'][$k]=$v;<br />
}</code></p>
<p>You could use:</p>
<p><code>$_SESSION['post'] = $_POST;</code></p>
<p>Its less code, and not as processor intensive.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

