Forum Moderators: open
- John
An example of what I'm using on the version of my site I'm currently working on...
<a href="<?php echo $_SERVER['PHP_SELF'];?>?audio=0&connection=0">Audio Disabled</a>
That choice is for dial-up with audio disabled. I initially tried reading the connection before the audio at the server and that did not help.
What tipped me was when I swapped audio and connection, so it looked like this...
<a href="<?php echo $_SERVER['PHP_SELF'];?>?connection=0&audio=0">Audio Disabled</a>
However now the server wasn't setting the audio cookie! But that was fine because I didn't need any more hints to see this bug. Webkit does not properly process encoded ampersands!
Also using & or & alone does not work (in case those who find this are dealing with the same issue).
The "Fix"
I tried using & and that did not work either. I knew that I'd have to cloak for Safari...again! Thankfully Safari 3 on XP does not suffer from this bug...can anyone confirm on this bug has disappeared from Safari 3 on OSX please?
Here is my cloaking fix. Keep in mind I still have to modify this to detect OSX's presence and not cloak for Windows...
- John
<?php if (!preg_match("/WebKit/", $useragent)) {
// Is not Webkit?>
<div id="broadband">
<span class="highlight">Broadband</span>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?audio=2&connection=1">Hi-Fi Audio Enabled</a>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?audio=0&connection=1">Audio Disabled</a>
</div><div id="dialup">
<span class="highlight">Dial-Up</span>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?audio=1&connection=0">Low-Fi Audio Enabled</a>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?audio=0&connection=0">Audio Disabled</a>
</div><?php } else {
// Is Webkit
?><div id="broadband">
<span class="highlight">Broadband</span>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?webkit=4">Hi-Fi Audio Enabled</a>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?webkit=3">Audio Disabled</a>
</div><div id="dialup">
<span class="highlight">Dial-Up</span>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?webkit=2">Low-Fi Audio Enabled</a>
<br />
<a href="<?php echo $_SERVER['PHP_SELF'];?>?webkit=3">Audio Disabled</a>
</div>