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? Link to comment https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/ Share on other sites More sharing options...
requinix Posted May 3, 2013 Share Posted May 3, 2013 = is for assignment, == is for comparison. 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. Link to comment https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/#findComment-1428085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.