I guess I just don’t know how it could be correct syntax as
pageaddress wasn’t set as a variable and I thought that if you are going to validate a string against another string they should both be double quoted.
“pageaddress” == “page1.php” which to me really doesn’t make sense, becuase it would always validate false. So I figured it must be a variable which would need the dollar sign for php to know that.
I just don’t know how this script even got through without passing any errors. I would venture to guess that error reporting is off?? And in the least its not displaying warnings?
I am guessing in the beginnning had the code had some sort of debugging in place professor would have found that the script was never validating or getting to the header and found there was something wrong with the if statement condition.
I would use error_reporting() function to make sure all errors are being displayed, unless you know for sure they are.
I would double check the structure of the condition in the if statement, I noticed mine had still missed one $.
Then I would get the correct syntax for the header function as Zyppora stated.
Correct/Check all of this and it should work.