Reputation: 3
thanks for your time in reading this. I am not a programmer but with my limited skills I have been able to determine that this function which is called at the beginning of almost every page is making our store POS script fail. When we goto our url for this PHP application we get only a blank page. When the call to this function is commented out, the pages load just fine.
The interesting thing to note is that no changes have been made to our code and it has been in use for over 3 years. Just stopped working a couple days ago and our webhost is useless. They haven't been able to tell me if there were any changes made to our server environment so I don't know where to start looking for information. My colleague suspects they may have changed the version of PHP that is in use, though I don't know which version might have preceded the one listed here.
Server Info -Apache version 2.2.29
-PHP version 5.4.33
-MySQL version 5.5.37-cll
-Architecture x86_64
-Operating system linux
// new version for SEO htaccess short url's
Function MakeSecure(){
if($_SERVER['HTTPS'] != "on"){
$URI = $_SERVER['REQUEST_URI'];
$strSiteLocation = "https://" . str_replace("/","",DOMAIN) . $URI;
header("Location: " . $strSiteLocation );
}
}
Upvotes: 0
Views: 64
Reputation: 3
So PHP was upgraded from 5.3 to 5.4 and the common class was passing variables by reference which is disallowed in 5.4. changed a line in the common class from
$cp = fsockopen (SMTP_HOST, SMTP_PORT, &$errno, &$errstr, 1);
to
$cp = fsockopen (SMTP_HOST, SMTP_PORT, $errno, $errstr, 1);
now the website is loading fine. Thanks to all who weighed in!
Upvotes: 0
Reputation: 42699
Unless you've set DOMAIN as a constant somewhere else, it's not going to redirect anywhere. Since you said this is at the top of your code, I suspect this is the case.
To confirm this, replace that final header()
call with a call to echo()
(output to browser) or error_log()
(output to your web server log file) instead. This will show you where it's trying to redirect you; I think it won't be a valid URL.
Upvotes: 1