Question

I am reviewing a website that was designed years ago. There is a problem on the contact page that spits an error:

Parse error: syntax error, unexpected T_LNUMBER in /home/content/p/r/e/prentexaf1/html/contact.php on line 61

Line 61 is that which starts: print"meta...

Here is the entire function around it:

function redirectTo($to) {

    $url = $to;

    print "<html><head><script>    location.href='$url'¥n  </script>";
    print "<meta HTTP-EQUIV=Refresh CONTENT=¥"0; URL=$url¥">";
    print "</head><body>If you see this page, click <a href=¥"$url¥">here</a> to continue</body>";
    print "</html>";
    exit;
}

I'm unfamiliar with php enough not to know what problem is happening here (I did not write this function, just am trying to solve the error for a friend that owns the site [also didn't write it]). I've looked up the meta tag info. My instincts says this is an issue following content but that's just a hunch. Please advise.. Thank you in advance!

Was it helpful?

Solution

Some of the double quotes needed to be escaped. (Besides the funky ¥ characters which have been removed)

function redirectTo($to) {

    $url = $to;

print "<html><head><script>location.href='$url'</script>";
print "<meta HTTP-EQUIV=Refresh CONTENT=\"0; URL=$url\">";
print "</head><body>If you see this page, click <a href=\"$url\">here</a> to continue</body>";
print "</html>";
exit;
}

they (quotes) might have been accidently replaced with that character, using a Word processor of sorts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top