Jump to content

Recommended Posts

Hi i followed a tutorial to create a register, login, members list and member profile pages but when i register, login and go to members list, the page its blank, i viewed the source code for the members page and its clearly trying to show something but i dont know what to do? Can any body help me please.

Link to comment
https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/
Share on other sites

members.php:

 

<?php
session_start();
require 'database.php';
$nuser=$_SESSION['user'];
$auser=$_SESSION['admin'];

if($nuser){
$userfinal=$nuser;
}elseif($auser){
$userfinal=$auser;
}
if(isset($userfinal)){
$Members = mysql_query("SELECT username FROM user WHERE level ='1' ORDER BY level DESC") or die(mysql_error());
$numRowsMembers = mysql_num_rows($Members);
?>

<table border="0">

<?php
for($count = 1; $count <= $numRowsMembers; $count++)
{
    $name = mysql_fetch_array($Members);
    ?>
    
    <tr>
    <?php
    echo '<td><a href="member_profile.php?username=' . $name['user'] . '">' . $name['user'] . '</a></td>';
    ?>
    </tr>
    
    <?php
}
} else {
echo "You are not logged in. Please log in to continue";
}
?>
</table>

 

 

Source code for members.php:

<table border="0">

    
    <tr>
    <td><a href="member_profile.php?username="></a></td>    </tr>
    
        
    <tr>
    <td><a href="member_profile.php?username="></a></td>    </tr>
    
    </table>

Hi guys i am back again, i have tried integrating the script into my page design but an error has appeared that i do not understand. most of it is hidden because the font color is the same as the background but it says:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/aretheyh/public_html/nealeweb.com/index.php:16) in /home/aretheyh/public_html/nealeweb.com/index.php on line 2

 

here is the link to the page where the error appears = http://www.nealeweb.com/index.php

I did read it but it makes no sense to me i am sorry, i have no coding or php experience so i dont understand all the session starts, echos, outputs or any of it.

 

It's only been 15 minutes, it's hard to believe you really tried to read/understand/fix the issue.  Like BlueSky mentioned, you CANNOT have any output before session_start().  Please post the first 10 lines of your current code.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.