Help with OR (||)

Hi again everyone, just trying to add a line to my working registration script, but it isn’t working and I would love to know why:

<?php
if (isset($_POST['register'])) {
	require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/conn.php';
	$register_username = mysqli_real_escape_string($link, $_POST['register_username']);
	$register_email = mysqli_real_escape_string($link, $_POST['register_email']);
	$register_emailtwo = mysqli_real_escape_string($link, $_POST['register_emailtwo']);
	$register_password = mysqli_real_escape_string($link, $_POST['register_password']);
	$register_salt = md5($register_password . 'salt');
	[B]if (empty($register_username) || if empty($register_email) || if empty($register_emailtwo) || if empty($register_password)) { echo 'Please fill out all required fields.'; }[/B]
	if ($register_email != $register_emailtwo) { echo 'Emails do not match.'; }
	else
	if (!empty($register_username) && !empty($register_email) && !empty($register_emailtwo) && !empty($register_password)) {
	$checkuser = mysqli_query($link, "SELECT username, email FROM members WHERE username = '$register_username' AND email = '$register_email'");
	$result = mysqli_num_rows($checkuser);
	if ($result == 1) {
	echo 'Username and/or email is taken, please try again.';
	exit();
	}
	if ($result == 0) {
		$sql = "INSERT INTO members SET username = '$register_username', email = '$register_email', password = '$salt'";
		}
		if (!mysqli_query($link, $sql)) {
			$error = 'Error: ' . mysqli_error($link);
			include 'error.php';
		}
		else {	
		include 'success.php';
		exit();
		}
	}
}
?>

everything works fine except the bolded line. can anyone point out why for me?

I just found this page, which might help:

http://stackoverflow.com/questions/2133705/how-to-test-more-than-one-var-if-is-empty-in-php

The only other comment I’d make is that your code is not consistent in that line. I don’t know if this is valid PHP or not, but maybe this would be better:

if (empty($register_username) || empty($register_email) || empty($register_emailtwo) || empty($register_password)) { echo 'Please fill out all required fields.'; }

Woah, that works fine like that - I swear I actually tried it like that too!

Thank you so much!