McInfo wrote:So, after you click the link, your address bar contains "%26" but $_SERVER['QUERY_STRING'] contains "&"? Very strange...
Yeah that's correct... I thought it was strange too.
McInfo wrote:I suppose some more diagnostics couldn't hurt.
Code: Select all
var_dump(ini_get('auto_prepend_file'));
var_dump(ini_get('arg_separator.output'));
var_dump(ini_get('arg_separator.input'));
Is there a chance that Apache is rewriting the URL?
The output of those diagnostics are:
string(0) "" string(5) "&" string(1) "&"
The server I'm using is basically a brand new CentOS server, and it's running the pre-installed apache. I've done no customisations to it at all really... Definitely haven't touched anything to do with url rewriting.
Here's an interesting thing. I just tried creating a brand new file, one directory up from where my site is on my server. This contains the following (previous code I used on an existing page to test):
Code: Select all
<?php
if (isset($_GET['value'])) {
header('Content-Type: text/plain');
echo $_SERVER['QUERY_STRING'];
echo "<br /><br />";
print_r($_GET);
} else {
header('Content-Type: text/html');
?><a href="?value=Jack%20%26%20Jill">Continue</a><?php
}
?>
Surprisingly, it works as expected. ie. $_GET contains 'value', which equals 'Jack & Jill'. Now I'm terribly confused.
Ok, I just played around some more with the pages I was testing it on. I'm using a SMF Forum along with the website, and I'm incorporating the authentication system it uses, which is made really easy by including SSI.php from the forums directory. I took the reference to this file out, commented out my authentication code, and voila... Now things are playing happily.
So the problem lies there, somewhere. There must be some sort of setting in the SMF Forums authentication system that is causing this problem. Time to investigate.