<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018564" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018564</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookie#comment-1109198</link>
    <description> &lt;p&gt;You can&#039;t access a cookie before it&#039;s set.&lt;/p&gt;
&lt;p&gt;$challenge = $HTTP_COOKIE_VARS[&quot;challenge&quot;];&lt;br /&gt;
This is assigning the value of a cookie named &quot;challenge&quot; to a variable named $challenge.  At this point, there is no cookie named &quot;challenged&quot;.&lt;/p&gt;
&lt;p&gt;setcookie(&quot;challenge&quot;,&quot;yes&quot;,time()+14400,&quot;/&quot;,&quot;.neverplaysober.com&quot;,0);&lt;br /&gt;
This is creating a cookie named &quot;challenge&quot;.  Only after you have created this cookie can you access it.&lt;/p&gt;
&lt;p&gt;I think what you want is this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$HTTP_COOKIE_VARS&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;challenge\&quot;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // user has been here before&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (\&quot;Try again in 4hours!\&quot;); &lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; include &#039;challenge1.php&#039;;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 May 2002 17:16:13 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1109198 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookie#comment-1109191</link>
    <description> &lt;p&gt;ok, I&#039;ve set up 2 pages.. one with this code.. The include page has a form that will be sent to a page that mails me the submited info. Then it&#039;s forwarded to another page that has a cookie.&lt;/p&gt;
&lt;p&gt;Form page&lt;br /&gt;
------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$challenge &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$HTTP_COOKIE_VARS&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;challenge&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$challenge1 &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$HTTP_COOKIE_VARS&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;challenge&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$challenge &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;== &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$challenge&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) { &lt;br /&gt;print (&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Try again in 4hours!&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;} else {&lt;br /&gt;include &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;challenge1.php&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------&lt;br /&gt;
cookie page&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;setcookie&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;challenge&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;yes&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;()+&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;14400&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;.neverplaysober.com&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now the form page works fine If I visite the cookie page first. If I visit the form page first I get the following errors..&lt;/p&gt;
&lt;p&gt;Notice: Undefined index: challenge in C:\Inetpub\finalphase\neverplaysober\v4\test\challenge.php on line 8&lt;/p&gt;
&lt;p&gt;Notice: Undefined index: challenge in C:\Inetpub\finalphase\neverplaysober\v4\test\challenge.php on line 9&lt;br /&gt;
I like blue too!&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 May 2002 06:46:55 +0000</pubDate>
 <dc:creator>venom</dc:creator>
 <guid isPermaLink="false">comment 1109191 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookie#comment-1109189</link>
    <description> &lt;p&gt;You can&#039;t access $HTTP_COOKIE_VARS[&#039;cookie&#039;] because you haven&#039;t yet set that cookie variable.&lt;/p&gt;
&lt;p&gt;try lowering the error_level:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;error_reporting&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cookie&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$HTTP_COOKIE_VARS&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;cookie&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;setcookie &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;cookie\&quot;, \&quot;test\&quot;, time()+3600);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 May 2002 05:20:07 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1109189 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
