PHP Conditionals ERROR message

``` Please explain how am I getting an error, when the output is being shown in the console window, not to mention, the variable is set to 8 which is greater than 5 but yet its error states I haven't changed the variable to a number greater than 5........


After countless refreshes, and repeatedly changing the number (to the same number, 8), it finally passed for me… I don’t know why the PHP course is so lagging and is constantly telling me an error at the bottom, but with several refreshes and no actual changes to the code, it will finally pass…


AND another one! Have refreshed a dozen times and this same error keeps popping up.


Did your try using print instead of echo?


No, as I stated it finally worked with echo. I do know about print, but I figured since print hasn’t even been covered here yet, why try it. The first one, I didn’t change any code just refreshed the screen a dozen times and it finally passed. The second one however, was simply an exclamation point missing at the end of “5% discount” output. But am still curious as to why I keep having to refresh the page to get something to pass, and it’s only a problem I’ve encountered with the PHP course.


There is a real time refresh rate on the PHP courses which can lead to a lot of issues, especially once you get to loops. Starting with the next lesson, make a habit of having this on your clipboard, ready to paste in just above your working code area…

<?php else ?>

It will throw a parse error and disable the auto refresh.

When you are ready to test or submit, Cut that snippet so it is ready for the next lesson, or to be pasted back in if your code does not run as expected. You do not have to submit to see the result. It will run almost immediately after you cut the snippet. Submit when ready to be graded.


Thank you for the tip @mtf, I will try it, and let you know if that has helped resolve the issue.

@mtf thank you for that tip of using <?php else ?> it worked like a charm!


@mtf the trick works, but only so the real time interpretation doesn’t take place, but it really seems as if the PHP course itself just has too many flaws and bugs. Honest opinion, is the PHP course is crap, but hey I still applaud them for trying. It continues to throw errors that I don’t understand why it’s throwing the error when I have done exactly what the instructions state to do… Can you see anything wrong here? I am using the strlen() function and the code has been printed to the console but it still says I didn’t use the function. I’m very close to just giving up on this PHP course and I really don’t want to, because I do feel like I’m learning from it, but only when it wants to actually work properly.


Try a refresh of the page. That might help.

As for the course, it is outdated and due to be sunsetted. Not sure it will be replaced with a new one, either.


Yeah I seen that they were supposed to be retiring this course and didn’t have an updated one in sight. That’s why I figured I would try and finish the course before it’s deleted. But it’s so frustrating, I see why they may not put a new one up of PHP. And the refreshes finally worked, but before I even posted that I had refreshed literally at least 20x and even rewrote it multiple times. All in all I think I refreshed the page at least 30x before it finally worked.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.