# Im new and Need help!!!!!!!!

**URL:** <https://www.phphelp.com/t/im-new-and-need-help/15523>\
**Category:** General Database (Oracle, SQL Server, etc)\
**Created:** [January 12, 2012, 12:48pm UTC](https://www.phphelp.com/t/im-new-and-need-help/15523 "2012-01-12T12:48:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikekandf](https://www.phphelp.com/letter_avatar_proxy/v4/letter/m/cc9497/32.png) [@mikekandf](https://www.phphelp.com/u/mikekandf)\
**Post date:** [January 12, 2012, 12:48pm UTC](https://www.phphelp.com/t/im-new-and-need-help/15523/1 "2012-01-12T12:48:36Z")

</div>

Im new and trying to learn this stuff. I have an index a login a register but i cant register all it does is go to a blank screen. here is my code…

[code]

[/code]

[php]

\<?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."; } ?\>

[/php]

[code]

[/code]

PLEASE HELP thanks 🙂
