Jump to content

nealec

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by nealec

  1. 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>
  2. 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.
  3. Thankyou for the reply, im probably goin to annoy you now by being so stupid, but am i supposed to paste the code you just left somewhere in my regcheck.php file? // echo "You Are Registered And Can Now Login"; // Why? // $formUsername = $username; // Why? header ('location: Login.php'); exit; I have no idea what im doing or what echos are.
  4. Ok great thanks, does that include Register, Login and some kind of profile creation?
  5. Hi i am making a website for my family and i would like them to be able to log in to it and create themselves a profile page, but i have no idea how to write code of any kind, any help would be great.
  6. Sorry, Here it is. <?php if( isset( $_POST['user'] ) && isset( $_POST['pass'] ) ) { if( strlen( $_POST['user'] ) < 4 ) { echo "Username Must Be More Than 4 Characters."; } elseif( strlen( $_POST['pass'] ) < 4 ) { echo "Passwrod Must Be More Than 4 Characters."; } elseif( $_POST['pass'] == $_POST['user'] ) { echo"Username And Password Can Not Be The Same."; } else { include( 'database.php' ); $username = mysql_real_escape_string( $_POST['user'] ); $password = md5( $_POST['pass'] ); $sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username ."'"; if( mysql_num_rows( mysql_query( $sqlCheckForDuplicate ) ) == 0 ) { $sqlRegUser = "INSERT INTO user( username, password ) VALUES( '". $username ."', '". $password ."' )"; if( !mysql_query( $sqlRegUser ) ) { echo "You Could Not Register Because Of An Unexpected Error."; } else { echo "You Are Registered And Can Now Login"; $formUsername = $username; header ('location: Login.php'); } } else { echo "The Username You Have Chosen Is Already Being Used By Another User. Please Try Another One."; $formUsername = $username; } } } else { echo "You Could Not Be Registered Because Of Missing Data."; } ?>
  7. Hi thanks for the reply, i didnt write any of this code and i dont know what im doing at all, pls could i send u the code and you tell me what to do?
  8. Hi can someone pls help, im tryin a tutorial but keep getting errors, this is the first one i get after registering. You Are Registered And Can Now Login Warning: Cannot modify header information - headers already sent by (output started at /home/aretheyh/public_html/nealeweb.com/regcheck.php:43) in /home/aretheyh/public_html/nealeweb.com/regcheck.php on line 46
×
×
  • 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.