Jump to content

Archived

This topic is now archived and is closed to further replies.

xyn

Sessions Porblems :/

Recommended Posts

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...
[code=php:0]<?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...
}
?>[/code]

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.

Share this post


Link to post
Share on other sites
You should check what $_SESSION['EumodUK'] really is set to, using something like:

[code=php:0]var_dump($_SESSION['EumodUK']);[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.