Page 1 of 1

IE Mac putting in strange characters

Posted: Mon Nov 03, 2003 4:56 pm
by MtnBiker
The following is the HTML

Code: Select all

<a href="<?php readfile ("includes/phpbbPath.inc"); ?>viewforum.php?f=5" title="to the For Sale section of the Discussion Groups">For Sale and Wanted to Buy</a>
includes/phpbbPath.inc contains only:

Code: Select all

phpBB2/
no spaces before or after the text

and here is what IE Mac OS X shows as the URL

Code: Select all

http://www.sbmbc.com/ÔªøphpBB2/viewforum.php?f=5
Safari and Mozilla see it correctly (without the Ôªø).

How can I avoid this? This is not the only place I get extra characters with PHP, but this breaks the URL, the others just look strange and confuse people.

Thanks for any suggestions.

Posted: Mon Nov 03, 2003 5:30 pm
by Gen-ik
Try this....

Code: Select all

<a href="<?php require("includes/phpbbPath.inc"); ?>viewforum.php?f=5" title="to the For Sale section of the Discussion Groups">For Sale and Wanted to Buy</a>

If you use readfile() PHP will load it as Binary not as plain/text.

Posted: Mon Nov 03, 2003 6:24 pm
by MtnBiker
Gen-ik wrote:Try this....

Code: Select all

<a href="<?php require("includes/phpbbPath.inc"); ?>viewforum.php?f=5" title="to the For Sale section of the Discussion Groups">For Sale and Wanted to Buy</a>

If you use readfile() PHP will load it as Binary not as plain/text.
Doesn't make any difference. Thank you for trying.

Posted: Mon Nov 03, 2003 7:09 pm
by Gen-ik
Well why don't you just setup a variable and use that instead. It will be quicker than having to include external files all the time.

Code: Select all

<?
$phpbbPath = "phpBB2/";
?>

<a href="<?php echo $phpbbPath; ?>viewforum.php?f=5" title="to the For Sale section of the Discussion Groups">For Sale and Wanted to Buy</a>
Or you can do it this way...

PHPBBPATH.INC

Code: Select all

<?php
$phpbbPath = "phpBB2/";
?>
PHP PAGE

Code: Select all

<?php
include("includes/phpbbPath.inc");
?>

<a href="<?php echo $phpbbPath; ?>viewforum.php?f=5" title="to the For Sale section of the Discussion Groups">For Sale and Wanted to Buy</a>