<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1039040" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1039040</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/problems-phpbb-main-site#comment-1221934</link>
    <description> &lt;p&gt;1. When you login through the main site, you have to click to a different page before the login area shows that you have logged in.&lt;br /&gt;
&lt;strong&gt;REPLY:&lt;/strong&gt;&lt;br /&gt;
without looking at the code, I would take a guess that the bit that displays either the login form or users details WHEN they are logged in is in the wrong place in your code&lt;br /&gt;
so maybe when a user logs in, the page refreshes but that login area doesnt?&lt;br /&gt;
the typical mistake are things within a header page (the page that draws all your top navigation links etc) gets drawn BEFORE the code has determined IF something&lt;br /&gt;
in your case the top box with the user login form or users details if logged in will be drawn by the header page BEFORE the code in the index.php has had chance to determine if the user is logged in or not&lt;/p&gt;
&lt;p&gt;They are just guesses, the best way to find out is to trace though your code thinking in your head what happens. Find where that login form is in your code editor and imagine filling it out, then where does the code go next, or what does it do?&lt;br /&gt;
follow through your code all the way and you should find why it needs a second page load to accept a user is logged in&lt;br /&gt;
(maybe its on the same page within a if/else...if so then the page obviously isnt reloaded, and the user will only be shown as logged in when the user clicks another (or the same) page and the if/else statement is re-read by the server again)&lt;/p&gt;
&lt;p&gt;And of course have a good look at the code in your login.php file and wherever the code is that checks if a user is logged in or not&lt;br /&gt;
my guess would be the user goes to login.php, the info they put in the form matches a user and logs them in, BUT the code that checks if they are logged in or not IS NOT executed from their journey from login.php back to index.php (or whatever page it redirects them to)&lt;/p&gt;
&lt;p&gt;2. No matter what, when you click on the &quot;Contact&quot; page, it shows the login form, even if you are logged in.&lt;br /&gt;
&lt;strong&gt;REPLY:&lt;/strong&gt;&lt;br /&gt;
It actually shows the contact form too, so I would check the page form.php and make sure it is correctly identifying a users is logged in, and check the code on that page that displays [either] the login form [or] the users details (the box in the upper left hand side)&lt;/p&gt;
&lt;p&gt;Coupled with number 1, you definitely need to investigate your code that determines when a user is logged in or not&lt;/p&gt;
&lt;p&gt;3. How can I make it so that when you log in or log out from the main site, you get redirected to the page where you logged in or logged out from.&lt;br /&gt;
&lt;strong&gt;REPLY:&lt;/strong&gt;&lt;br /&gt;
I&#039;m not 100% sure what you want, but within your form in the upper left hand box that logs users in, you have a form&lt;br /&gt;
when username and password are filled in, and the login button pressed, the user is taken to login.php with the info from that form POSTED&lt;br /&gt;
So I would imagine in login.php page, you could use an if/else to send users wherever you want&lt;br /&gt;
if login successful then goto page&lt;br /&gt;
else goto page (or stay at same page and echo &quot;invalid login&quot;)&lt;br /&gt;
If you want to send them back to where they came from&lt;br /&gt;
you can get the URL info in php with code, so you could put that info in the form and post it to your login.php page, so when login == successful then send them to the page using the URL info you posted in the login form&lt;br /&gt;
whatever page your user is on, when they click the login form, the URL info that will be psted will be the current page they are on&lt;br /&gt;
thus sending them back to where they came from &lt;/p&gt;
&lt;p&gt;(there are some nifty php coders on this site though, who might have a simpler solution)&lt;/p&gt;
&lt;p&gt;4. Lastly, the feature that I really want to incorporate is so that users must be logged in and have x number of posts before they can download.&lt;br /&gt;
&lt;strong&gt;REPLY:&lt;/strong&gt;&lt;br /&gt;
As it&#039;s a phpbb forum, and their posts are recorded in a database, then you can get individual users post count from their individual id&lt;/p&gt;
&lt;p&gt;so you want to be making code that checks the current logged in users database row for how many posts they have had, either by counting all the rows for their post inputs, or even create a new row that counts them for you&lt;/p&gt;
&lt;p&gt;then&lt;br /&gt;
if ( $post_count &amp;lt; $x_amount) { echo &quot;sorry not enough posts&quot; } etc&lt;br /&gt;
else { goto download }&lt;/p&gt;
&lt;p&gt;have a look at this (Control access to view / post in forums based on a user&#039;s post count.)&lt;br /&gt;
&lt;a href=&quot;http://www.phpbb.com/community/viewtopic.php?t=471142&amp;amp;sid=7d1ad6a80ecd55a1e6688583acaaa513&quot; class=&quot;bb-url&quot;&gt;http://www.phpbb.com/community/viewtopic.php?t=471142&amp;amp;sid=7d1ad6a80ecd55a1e6688583acaaa513&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;it isnt exactly what you are wanting, but it should give you some ideas as to how to check users post counts in phpbb, then define an if/else clause, of course you will change yours to allow a link if they have the minimum posts, or issue a statement reminding/informing them they have to have x posts before downloading&lt;/p&gt;
&lt;p&gt;one thing I will say about number 4.&lt;/p&gt;
&lt;p&gt;Be careful of limiting people from things until x posts in a forum&lt;br /&gt;
many people will just post rubbish to hit their target.&lt;br /&gt;
not neccesarily spam, but nonetheless rubbish that may not be filling your forum with meaningful topics.&lt;/p&gt;
 </description>
     <pubDate>Fri, 20 Jul 2007 15:43:07 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1221934 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
