Código PHP:
var $id, $nombre, $direccion, $telefono, $correo;
function registrar ($nombre, $direccion, $telefono, $correo){
$this-> nombre = $nombre;
$this-> direccion = $direccion;
$this-> telefono = $telefono;
$this-> correo = $correo;
$sql = "SELECT * FROM usuario WHERE telefono='".$telefono."'";
$result = mysql_query ($sql, conectar::conexion());
$contar = mysql_num_rows($result);
if ($contar==0){
}else{
echo '<script type="text/javascript">
alert ("Denegado: telefono Registrado");
window.location.href=nuevo_usuario.php";
</script>';
}
les agradecería mucho la ayuda.