URL variable passing proble:
Posted by mpawski (mpawski), 19 August 2006The following works fine with Firefox:
<a ref='http://xxxx.com/mail/read.php?filer=$arr[$key]' target='_blank'></a>;
It generates a URL like this:
Firefox opens up the page just peachy. I then get the variable with $_GET.
Trouble is, the page won't even open with IE. I get HTTP 400 - Bad Request and Page cannot be found. I've logged onto other sites and php pages with variables passed in the prescribed manner with IE, but no luck on my own site. Is this a problem with my server or php configuration?. Does IE have to be treated special? (I hate IE).
(Of course, it seems EVERYTHING works with Firefox <g>.)
Posted by admin (Graham Ellis), 19 August 2006The problem won't be with your server, nor with your configuration. It'll be something a bit odd in the source of the page that sends out the link - some HTML that's not quite right and that Firfox can handle AOK but causes Explorer to cough.
If you "view source" on either the Firefox or Explorer browser, then you'll see exactly what code they have received and you should be able to spot the bit of your HTML that's out of spec and which is handled differently by them when you submit; if you can't spot it, post up a few lines of that source here.
Posted by mpawski (mpawski), 19 August 2006Thanks for your response. I can't spot it. Here are three table rows from the html code as reported by IE.
It's the '<a href' part that seems to be the problem. (I can make it open 'read.php' by itself without the variable. Read.php is in the same directory as this code and expands to the domain properly). It seems to have trouble with the passed variable (the '?'). The address bar reports the full URL properly along with the variable, but won't open.
DJ Nobody *firstname.lastname@example.org</td>
<a href='read.php?filer=200608182327235297165722648' target='_blank'>Re: [kusf-volunteers] !!!!THIS is REALLY IMPORTANT!!!!!!</a>
August 18 2006 23:56:44</td>
Posted by admin (Graham Ellis), 19 August 2006You're right ... it's NOT obvious at all. You say it works without the parameter, but not with the parameter; have you tried other variants too, such as spcifying the URL fully, and specifying it in double quotes - looking for a pattern in the failures? Do you have accesss to you server error log files? Do they give you any extra text to describe why the error 400 occured - there should be some clues there.
Posted by mpawski (mpawski), 19 August 2006CRAP!! Excuse me. I feel really stupid for not checking the server error log (Apache 2). I had the directory controlled by digest. The error:
Digest: uri mismatch - </mail/read.php> does not match request-uri </mail/read.php?filer=200608182327235297165722648>
When I remove the digest controls and go with 'Allow from all', IE works. Apparently IE is more secure than Firefox?. I do want the directory controlled and I'll have to work around this somehow. Thanks for your help. I should look in the obvious places for clues first.
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho