nealec Posted January 27, 2011 Share Posted January 27, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/ Share on other sites More sharing options...
BlueSkyIS Posted January 27, 2011 Share Posted January 27, 2011 post php code. and the source you viewed. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166076 Share on other sites More sharing options...
Maq Posted January 27, 2011 Share Posted January 27, 2011 Please post the code. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166077 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166079 Share on other sites More sharing options...
BlueSkyIS Posted January 27, 2011 Share Posted January 27, 2011 do you have HTML and BODY tags? Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166083 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 No that is the whole members page script, i copied and pasted it from a tutorial named it members.php then uploaded it Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166085 Share on other sites More sharing options...
BlueSkyIS Posted January 27, 2011 Share Posted January 27, 2011 some browsers will not display text as HTML if there is no HTML or BODY tags, not to mention it's just invalid HTML. That code looks like it should be in part of a complete HTML page. I would add HTML/BODY tags to see if that helps. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166088 Share on other sites More sharing options...
PFMaBiSmAd Posted January 27, 2011 Share Posted January 27, 2011 Since there is nothing as the textual part of the link, nothing is displayed/rendered in the browser (at least in FF.) You are selecting username in your query, but referencing user in your php code. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166093 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 Excellent thankyou very much guys its now working Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166099 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166137 Share on other sites More sharing options...
BlueSkyIS Posted January 27, 2011 Share Posted January 27, 2011 there can be no output: no HTML, no spaces, no nothing before session_start() Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166171 Share on other sites More sharing options...
Maq Posted January 27, 2011 Share Posted January 27, 2011 Please read the sticky - HEADER ERRORS. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166178 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 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. Please help Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166188 Share on other sites More sharing options...
Maq Posted January 27, 2011 Share Posted January 27, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166192 Share on other sites More sharing options...
nealec Posted January 27, 2011 Author Share Posted January 27, 2011 I did read it before i posted. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 6</title> </head> <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"> <div align="center"> Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166196 Share on other sites More sharing options...
Maq Posted January 27, 2011 Share Posted January 27, 2011 You are outputting HTML to the browser prior to calling session_start, you cannot do this. Quote Link to comment https://forums.phpfreaks.com/topic/225870-httpwwwnealewebcommembersphp/#findComment-1166199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.