I think visualAd is trying to get you to learn how to debug your code, so I am not going to spoil that.

In that code there are 5 problems...

There is 1 fatal error, 2 errors in the SQL query and 2 problems with the logic.

If you are not getting an error message, then turn errors on using
PHP Code:
error_reporting(E_ALL); 
Or look in the access log for the error. When you do see the error, it should be obvious what the problem is.

When you have solved the fatal error which is halting the script. You can then look at solving the problems in the SQL query. If a MySQL query is not doing what it is supposed to, you can get the error message using the mysql_error() function like so:
PHP Code:
echo mysql_error(); 
As for the logic, I don't know how anyone can easily read your logic with those if/else statements written like that, you should tab them properly.

The first logic problem I see is you are echoing "registration failed" if the password is blank. That's not an accurate error message, it should be like your others "please enter a password".

Secondly, you are echoing "Registration successful" after the query, regardless of the result.... that means if the query failed, your program will still tell the user it was successful. You can put an if statement around the $query variable to check if it failed or not, and then you can give the user that information e.g.
PHP Code:
$query mysql_query($sql);

if(
$query)
{
   
//success
}
else
{
   
//failed

Lastly, you have a lot of echo statements with error messages, why not put the message in a $msg variable and just use one echo statement at the end. This way you can add HTML markup to the echo without having to go through all of your echo statements.