<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018732" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018732</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110677</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by Mark Hensler &lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;..Finally, depending on your PHP version, register_globals may be turned off.  If this is the case, you&#039;ll need to specify that your trying to access a cookie variable.  You can use $_COOKIE[&#039;username&#039;] and $_COOKIE[&#039;password&#039;] with the latest version of PHP. &lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;i&#039;d also like to suggest (being the anal code purist that i am) that you never rely on globals being registered in any of your scripts.  Dont let it become a habit.&lt;/p&gt;
&lt;p&gt;ALWAYS get your data from $HTTP_GET_VARS(or $_GET), $HTTP_POST_VARS(or $_POST), $HTTP_COOKIE_VARS(or $_COOKIE), or the all-encompassing $_REQUEST.&lt;/p&gt;
 </description>
     <pubDate>Sat, 22 Jun 2002 01:27:14 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1110677 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110569</link>
    <description> &lt;p&gt;Hehe, glad it worked out for you.&lt;br /&gt;
&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 19 Jun 2002 19:24:45 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110569 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110557</link>
    <description> &lt;p&gt;When I set the cookie it was in the case I have it now. So that&#039;s not the problem. I think my server has the newest v. of PHP so I&#039;ll try that Mark.&lt;/p&gt;
&lt;p&gt;EDIT: IT WORKS!!! w00taness! Thanks guys. You&#039;ve been a great help!&lt;/p&gt;
 </description>
     <pubDate>Wed, 19 Jun 2002 13:43:21 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1110557 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110535</link>
    <description> &lt;p&gt;Also I noticed that you are using $username = $_COOKIE[&quot;&lt;strong&gt;U&lt;/strong&gt;sername&quot;]; (uppercase U). If when you set the cookies, the &quot;username&quot; is all lowercase, you should have the &quot;username&quot; all lowercase when you&#039;re getting the cookies as well. Same with &quot;password&quot;.&lt;/p&gt;
 </description>
     <pubDate>Wed, 19 Jun 2002 05:39:51 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110535 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110534</link>
    <description> &lt;p&gt;You might not have a version of PHP that is 4.2.0 or later...&lt;br /&gt;
instead of $_COOKIE[], use $HTTP_COOKIE_VARS[]&lt;/p&gt;
 </description>
     <pubDate>Wed, 19 Jun 2002 05:30:48 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1110534 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110525</link>
    <description> &lt;p&gt;Ok, I tried. Instead of getting a blank page the login page loads now. Here is the edited script:&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: #FF8000&quot;&gt;//Added these at the advice of Mark and Zollet. Thanks guys.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&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: #DD0000&quot;&gt;&quot;Username\&quot;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&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: #DD0000&quot;&gt;\&quot;Password\&quot;];&lt;br /&gt;&lt;br /&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp; if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$connect&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_connect(&#039;localhost&#039;,&#039;USER&#039;,&#039;PASS&#039;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$selectdb&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_select_db(&#039;DB&#039;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$connect&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$connect&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo (\&quot;Cannont connect to the database at this time. Please try at a different time.\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$selectdb&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo (\&quot;Cannont reach to the database at this time. Please try at a different time.\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(\&quot;SELECT * FROM users WHERE user=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$arow&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$arow&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;password\&quot;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$arow&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;user\&quot;];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; != &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo (\&quot;Invalid password, please go back and fix it.\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo (\&quot;You logged in! Your username is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; and your password is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; include (\&quot;index2.php\&quot;);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;} else {&lt;br /&gt;&amp;nbsp; include (\&quot;index2.php\&quot;);&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>Wed, 19 Jun 2002 01:57:08 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1110525 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110511</link>
    <description> &lt;p&gt;As Mark mentioned earlier, your $username and $password variables do not go from the first script to the 2nd script just like that. You have to retrieve them from the cookies.&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;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Try adding these two lines on top of your script..&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&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: #DD0000&quot;&gt;&quot;username\&quot;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&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: #DD0000&quot;&gt;\&quot;password\&quot;];&lt;br /&gt;&lt;br /&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp; if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 21:21:13 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110511 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110486</link>
    <description> &lt;p&gt;Ok. I did the stuff you told me to Mark and I did the script Zollet gave and the cookie showed up. But when I use the second script to find the cookies nothing happens. It&#039;s located &lt;a href=&quot;http://icc.ppnhost.ws/login&quot; class=&quot;bb-url&quot;&gt;here&lt;/a&gt; but first you have to &lt;a href=&quot;http://icc.ppnhost.ws/login/index2.php&quot; class=&quot;bb-url&quot;&gt;login&lt;/a&gt; with the user/pass of test/test.&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 16:08:34 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1110486 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110477</link>
    <description> &lt;p&gt;I don&#039;t know if this is of any use to you, but here&#039;s a small script that I use at times when I&#039;m working with cookies. It prints all your current cookies to your browser. You can use it for example to see if your cookies are set, etc.&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;foreach(&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;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$key &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; echo \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&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>Tue, 18 Jun 2002 10:31:13 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110477 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/php-cookies-really-time#comment-1110469</link>
    <description> &lt;p&gt;A couple things of note...&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//....&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;} else if (!isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&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;You don&#039;t need the ELSEIF.  If the first IF returns false, then there is no reason to test if !FALSE==TRUE.&lt;/p&gt;
&lt;p&gt;Variables in PHP are case sensitive.  So...&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;setcookie&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Username\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;setcookie(\&quot;Password\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;These will create cookie variables $Username and $Password.  These will not be accessed by your second script, which uses $username and $password.&lt;/p&gt;
&lt;p&gt;Finally, depending on your PHP version, register_globals may be turned off.  If this is the case, you&#039;ll need to specify that your trying to access a cookie variable.  You can use $_COOKIE[&#039;username&#039;] and $_COOKIE[&#039;password&#039;] with the latest version of PHP.&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 04:29:52 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1110469 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
