RonnieCosta50 Posted May 3, 2013 Share Posted May 3, 2013 This is a file called f2.php <?php $noError = 0; echo"Test 1 Passed</br>"; ?> This is a different file called f1.php <?php include 'f2.php';?> <?php echo"Test 2 Passed</br>"; if($noError = 0) { echo"Test 3 Passed"; } ?> Test 1 and 2 passed. $noError was equal to 0 both times. But it's not going into the If statement. The value of $noError has not changed. It is still 0. Why the is it not going into Test 3? Quote Link to comment https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/ Share on other sites More sharing options...
Solution requinix Posted May 3, 2013 Solution Share Posted May 3, 2013 = is for assignment, == is for comparison. Quote Link to comment https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/#findComment-1428084 Share on other sites More sharing options...
RonnieCosta50 Posted May 3, 2013 Author Share Posted May 3, 2013 Thank you so much. I've been trying to figure this out for over 3 hours. It's always syntax errors with me. Quote Link to comment https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/#findComment-1428085 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.