wrong:
echo'$PHP_SELF';
apostrofe will print $PHP_SELF in your form action!:
print htmlspecialchars($_SERVER["PHP_SELF"]);
wrong:
$add_all = 'INSERT INTO $table values('$username','$password','$email','$ip','$time','”;
$add_all = "INSERT INTO $table
(username, password, email, ip, time)
VALUES
('$username','$password','$email','$ip', NOW() )";
And use mysql_real_escape_string on the user's input values!
Use POST method then GET in your programs.