Recap...
Código PHP:
<html>
<head>
</head>
<body>
<?
//conexion
include("config.php");
//consulta para verificar existencia de nickname
$dos=mysql_query("select id from registro where nick='$nick'");
//verificando
if(mysql_num_rows($dos)!=0){
echo "ya existe ese nick";}
else{
$dir=$REMOTE_ADDR;
$insertar="insert into registro (nick,contrasena,email,sexo,ip) VALUES ('$nick','$contrasena','$email','$sexo','$dir')";
mysql_query($insertar);
echo mysql_error(); // En caso de error te aparecerá un error en el mensaje
echo "registro insertado";}
?>
</body>
</html>