<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040353" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040353</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/php-login-status-display#comment-1227258</link>
    <description> &lt;p&gt;AHHAH!!!&lt;br /&gt;
I sorted it.&lt;br /&gt;
all i did was add...&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;session_start&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;br /&gt;
to every page i wanted the code to work on, it simply reminds the browser that it has a session in progress. thanks for your help. Very much appreciated, it was your idea that gave me inspiration to do this.&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, 12 Dec 2007 22:26:00 +0000</pubDate>
 <dc:creator>Reece S</dc:creator>
 <guid isPermaLink="false">comment 1227258 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/php-login-status-display#comment-1227223</link>
    <description> &lt;p&gt;First of all, although I can&#039;t see it being the problem here, I would suggest creating variables with different names for the visitor&#039;s username and password and those for the MYSQL connection.&lt;/p&gt;
&lt;p&gt;Also, I think you need the following line before you start registering values on a session:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;session_start();&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;And where you try to do this, I think you should be inserting the variable, correct?&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;session_register(&amp;#039;$username&amp;#039;);&lt;br /&gt;session_register(&amp;#039;$password&amp;#039;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
I&#039;m not very experienced in using sessions, but this is how I would approach it based off of what I know. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 11 Dec 2007 23:54:30 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1227223 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/php-login-status-display#comment-1227214</link>
    <description> &lt;p&gt;I cannot seem to get it to work, here is my &quot;checklogin.php&quot; script...&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;$host&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;localhost\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&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;=\&quot;PASSWORD\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db_name&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=\&quot;DATABASE\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tbl_name&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=\&quot;TABLE\&quot;;&lt;br /&gt;&lt;br /&gt;// Connect to server and select databse.&lt;br /&gt;mysql_connect(\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$host&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;, \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;, \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;)or die(\&quot;cannot connect\&quot;);&lt;br /&gt;mysql_select_db(\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db_name&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;)or die(\&quot;cannot select DB\&quot;);&lt;br /&gt;&lt;br /&gt;// username and password sent from signup form&lt;br /&gt;&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;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;username&#039;];&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;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;password&#039;];&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=\&quot;SELECT * FROM &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tbl_name&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; WHERE username=&#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; and password=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;// Mysql_num_row is counting table row&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$count&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;// If result matched &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myusername&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$mypassword&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, table row must be 1 row&lt;br /&gt;&lt;br /&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$count&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;==1){&lt;br /&gt;// Register &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myusername&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$mypassword&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; and redirect to file \&quot;login_success.php\&quot;&lt;br /&gt;session_register(\&quot;username\&quot;);&lt;br /&gt;session_register(\&quot;password\&quot;);&lt;br /&gt;header(&#039;location:http://pcgenius.pcriot.com/members/basic/login/login_success.php&#039;);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;header(&#039;location:http://pcgenius.pcriot.com/members/basic/login/login_failed.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;
&lt;p&gt;What would I need to do to display the content of the created cookie on a different page?&lt;br /&gt;
Thanks you so much in advance, i am fed up of this now, i cannot seem to get the right script.&lt;/p&gt;
 </description>
     <pubDate>Tue, 11 Dec 2007 20:39:17 +0000</pubDate>
 <dc:creator>Reece S</dc:creator>
 <guid isPermaLink="false">comment 1227214 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/php-login-status-display#comment-1227212</link>
    <description> &lt;p&gt;Well, this would require the use of cookies and/or sessions, and here&#039;s how I would most simply do it:&lt;/p&gt;
&lt;p&gt;A log-in form would process to this page:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if username and password are verified {&lt;br /&gt;setcookie(&amp;#039;giveItAName&amp;#039;, $userNameVariable, $expiresWhen);&lt;br /&gt;echo &amp;quot;You are now logged in.&amp;quot;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
Then, on each page (I would place the code in a header that can be included on each page) you could see if the cookie exists:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if (isset($_COOKIE[&amp;#039;giveItAName&amp;#039;])) {&lt;br /&gt;$makeItAVariable = $_COOKIE[&amp;#039;giveItAName&amp;#039;];&lt;br /&gt;echo &amp;quot;Log out -&amp;quot; . $makeItAVariable . &amp;quot;-&amp;quot;;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;echo &amp;quot;Log in&amp;quot;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
You could make something much more elaborate than this, but this is basically how it works. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 11 Dec 2007 20:12:45 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1227212 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
