Jump to content


Photo

Sessions Porblems :/


  • This topic is locked This topic is locked
2 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 09 August 2006 - 09:19 PM

Hii.
I have got my news system, and I have allowd members to
comment the articles, However I only want registered members
to be able to comment. So i checked to see if the Logged In
session returns true.

If so they can comment, otherwise it says they must be logged in
or register if they don't have an account. My problem is whether the
member is logged in or not it still returns:

"only members can comment news articles" :/

my code...
<?PHP
		if($_SESSION['EumodUK'] != true) {
		echo '<div align="center">
  <center>
  <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%">
    <tr>
      <td width="100%">
      <hr color="#AAD2FF" width="95%" align="left" size="1" style="border: 1px dashed #AAD2FF">
      </td>
    </tr>
    <tr>
      <td width="100%">
      <p align="center" class="text">Only members can make comments.</td>
    </tr>
  </table>
  </center>
</div>';
		}else{
//rest of page...
}
?>

NOTE: the reason i don't have "session_start();" is because this is included
into a page containing the session_start(); and it says headers are already
sent.

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 09 August 2006 - 09:25 PM

You should check what $_SESSION['EumodUK'] really is set to, using something like:

var_dump($_SESSION['EumodUK']);

~ D Kuang

#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 09 August 2006 - 09:29 PM

Well I went the the "include" and put that exact code and it works..
So unless there was a problem with the includes who knows :/
Sorry If i wasted peoples time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users