<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040930" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040930</link>
    <description></description>
    <language>en</language>
          <item>
    <title>What exactly do you use the</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-sessions-problem#comment-1229402</link>
    <description> &lt;p&gt;What exactly do you use the $_GET with? Its value is usually assigned to a variable&lt;/p&gt;
&lt;p&gt;I.E.&lt;br /&gt;
$textboxname = $_GET[&#039;textboxname&#039;];&lt;/p&gt;
&lt;p&gt;Also, note the &#039; in my code, you might have them two in yours and just didn&#039;t type it in your post here (they are required though and will be the reason it doesn&#039;t work if they are missing).&lt;/p&gt;
&lt;p&gt;Another common reason why the $_GET might not work is if you have a typo on the form input or the process page - make sure the form input name is EXACTLY the same as the name you use the $_GET with on the page the form is sent to.&lt;br /&gt;
So both are  - textboxname&lt;/p&gt;
&lt;p&gt;But all the $_GET data is (if correctly done) in the URL (browser address bar), so look at that to check what the form is sending.&lt;/p&gt;
&lt;p&gt;And if there is an actual PHP coding error check the error logs. The errors don&#039;t always point to the error exactly, but it will give you some idea. And they don&#039;t always return an error if it is code that isn&#039;t actually deemed as error, such as a type in the names as mentioned above.&lt;br /&gt;
Just like wordprocessor spell checkers wont tell you if a word is out of context, they often just check it is an actual word.&lt;/p&gt;
&lt;p&gt;The error logs are usually created in the directory where the file resides that contains the error.&lt;/p&gt;
 </description>
     <pubDate>Mon, 31 Mar 2008 12:51:56 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1229402 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Your explanation is better</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-sessions-problem#comment-1229401</link>
    <description> &lt;p&gt;Your explanation is better than any tutorial on the net, thanks. I also found it useful to just print the values from page to page to check if they are actually being sent, although sometimes it didn&#039;t work for some reason when I used $_GET[textboxname] on the next page after submitting values in a form to another page, why is this?&lt;/p&gt;
&lt;p&gt;I also have another question related to sessions and transferring data from page to page but I made a separate thread.&lt;/p&gt;
 </description>
     <pubDate>Mon, 31 Mar 2008 10:53:49 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1229401 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>drew22299 wrote:

I&#039;m</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-sessions-problem#comment-1229391</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;drew22299 wrote:&lt;/strong&gt; I&#039;m guessing if I include the following at the top of every page I can then use the username in MySQL queries to return the information for a user?&lt;/p&gt;
&lt;p&gt;$_SESSION[&#039;username&#039;] = $username;&lt;br /&gt;
$_SESSION[&#039;password&#039;] = $password;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;What that is doing is giving the value of the variable $username to the $_SESSION[&#039;username&#039;].&lt;br /&gt;
So I presume the variable $username does contain data?&lt;br /&gt;
And you only need to run that code once, so you wouldn&#039;t really need to have it on every page. Once a session is set with a value, it will remain unless you destroy it, unset it, the user closes their browser or you change the value.&lt;/p&gt;
&lt;p&gt;What you MIGHT have on every page is&lt;br /&gt;
$username = $_SESSION[&#039;username&#039;];&lt;br /&gt;
$password = $_SESSION[&#039;password&#039;]; &lt;/p&gt;
&lt;p&gt;So that you can use the variables $username and $password to query the DB, as the variables wont carry their values from page to page (whereas the sessions do)&lt;/p&gt;
&lt;p&gt;A good idea that often reveals the problem is to echo the session to see what is happening.&lt;br /&gt;
echo $_SESSION[&#039;username&#039;];&lt;br /&gt;
echo $_SESSION[&#039;password&#039;];&lt;/p&gt;
&lt;p&gt;You might find something out such as the sessions are actually empty and that might point to the code that checks if user is logged in is incorrect in some way. Then it perhaps wouldn&#039;t show the login.&lt;br /&gt;
That&#039;s just an example, but echo the sessions and/or variables to find out what data they carry, also double check you code that doesn&#039;t work, such as the session destroy code. Are they destroying correctly named sessions?&lt;/p&gt;
 </description>
     <pubDate>Sat, 29 Mar 2008 19:26:44 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1229391 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Only certain pages can be</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-sessions-problem#comment-1229359</link>
    <description> &lt;p&gt;Only certain pages can be viewed when you are logged in.&lt;/p&gt;
&lt;p&gt;Does the code below need to be included to ensure the same user is logged in on every page?&lt;/p&gt;
&lt;p&gt;How do you carry the details from page to page so you can use them in SQL queries?&lt;/p&gt;
&lt;p&gt;$_SESSION[&#039;username&#039;] = $username;&lt;br /&gt;
$_SESSION[&#039;password&#039;] = $password;&lt;/p&gt;
 </description>
     <pubDate>Thu, 27 Mar 2008 16:17:18 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1229359 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>When clearing a session, I</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-sessions-problem#comment-1229350</link>
    <description> &lt;p&gt;When clearing a session, I always run unset($_SESSION) in addition to session_destroy().&lt;/p&gt;
&lt;p&gt;How are you testing to see if the user is signed in?&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Mar 2008 23:51:28 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1229350 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
