Page 1 of 1
Copying code
Posted: Wed May 11, 2011 4:58 pm
by Tino
Whenever I try to copy code from the syntax tags with Firefox, I don't seem to be able to copy it correctly, because I also get the numbers (actually, a bunch of hash signs) which completely mess everything up...
It doesn't happen in Chrome.
As an example:
1.
<?php
2.
3.
/*
4.
*
5.
* This file loads all file in the same folder as it.
6.
*
7.
*/
8.
9.
$files = glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . '*.inc.php');
10.
11.
foreach ($files as $file){
12.
include($file);
13.
}
14.
15.
?>
Re: Copying code
Posted: Wed May 11, 2011 6:59 pm
by jacek
That may be something to do with the different line encoding Linux (my laptop) uses.
Can you try some code that I did not post ?
Re: Copying code
Posted: Wed May 11, 2011 8:40 pm
by Tino
Happens with everything!
1.
<?php
2.
require('functions.php');
3.
?>
4.
5.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6.
<html xmlns="http://www.w3.org/1999/xhtml">
7.
<head>
8.
<title>Browser Identification</title>
9.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10.
</head>
11.
<body>
12.
<strong>Your Browser is: <?php echo $navegador; ?></strong><br />
13.
<p>
14.
<?php
15.
$pre = $_SERVER['HTTP_USER_AGENT'];
16.
17.
if(strpos($pre, "Firefox")!=0)
18.
echo"<img src='img/firefox.jpg' width='250' height='250' />";
19.
20.
else if(strpos($pre, "Chrome/11.0.696.60")!=0)
21.
echo "<img src='img/chrome.jpg' width='250' height='250' />";
22.
23.
else if(strpos($pre, "AppleWebKit/533.19.4")!=0)
24.
echo "<img src='img/safari.jpg' width='250' height='250' />";
25.
26.
else if(strpos($pre, "CLDC-1.1")!=0)
27.
echo "<img src='img/blackberry.JPG' width='150' height='150' />";
28.
29.
else if(strpos($pre, "MSIE 8.0")!=0)
30.
echo "<img src='img/ie.jpg' width='250' height='250' />";
31.
32.
else if(strpos($pre, "MSIE 9.0")!=0)
33.
echo "<img src='img/ie.jpg' width='250' height='250' />";
34.
35.
else if(strpos($pre, "AppleWebKit/530.17")!=0)
36.
echo "<img src='img/samsung.jpg' width='150' height='150' />";
37.
38.
else if(strpos($pre, "AppleWebKit/533.1")!=0)
39.
echo "<img src='img/htc.jpg' width='150' height='150' />";
40.
41.
42.
else
43.
echo"Unknown";
44.
45.
?>
46.
</p>
47.
</body>
48.
</html>
49.
Re: Copying code
Posted: Wed May 11, 2011 9:37 pm
by jacek
Which version of Firefox are you using ?
it seems okay in 4.0.1 for me.
Not really sure what I can do about it
Re: Copying code
Posted: Wed May 11, 2011 9:42 pm
by Tino
I'm still using 3.6.
Re: Copying code
Posted: Wed May 11, 2011 9:44 pm
by jacek
Tino wrote:I'm still using 3.6.
hmm, upgrade ?
I did used to have that issue on the unmentionable other site we are all members of.
I could turn off the line numbers I guess, but I would prefer not to as they are pretty useful when people posts errors.
Re: Copying code
Posted: Wed May 11, 2011 9:46 pm
by Temor
jacek wrote:Tino wrote:I'm still using 3.6.
hmm, upgrade ?
I did used to have that issue on the unmentionable other site we are all members of.
I could turn off the line numbers I guess, but I would prefer not to as they are pretty useful when people posts errors.
Yeah, they are indeed useful.
Re: Copying code
Posted: Wed May 11, 2011 9:52 pm
by Tino
Hmm, seems to work fine now
Re: Copying code
Posted: Wed May 11, 2011 9:53 pm
by jacek
The code for this mod is really not very clean so good news I don't have to mess with it