php include statement problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
/\ndy
Forum Newbie
Posts: 2
Joined: Tue Jan 20, 2004 11:19 am

php include statement problem

Post by /\ndy »

hi,
i'm a complete beginner to php, but know other programming languages like java, html, C.

i have this problem with my include statement in that a 1 character follows every statement: like at the page here:

http://andrewdalgleish.co.uk/index.php

there are two include statements, one for a script and one for the menu, here is the code:

Code: Select all

<head>
<title>andrewdalgleish.co.uk</title>
<!--the script-->
<?=include("menuscript.txt")?>
</head>
<body bgcolor="#C86060">
<center><table border="0" width="780" height="800>
<tr>
<td width="140" bgcolor="#C86060" cellspacing="4" cellpadding="4">
<td valign="top" width="142" bgcolor="#C86060">
<!--the menu code.-->
<?=include("menu.txt")?>

<td width="640" bgcolor="#97BB83" valign="top">

<!--content!!-->
index.php
</td>
</table></center>

</body>
oh, and when i just put the code into the file (without include, just copy and past it in) it works fine, there is no 1.

any ideas why this is happening?

andy.
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Post by phpcoder »

use this

Code: Select all

<?php include("menu.txt");
?>
/\ndy
Forum Newbie
Posts: 2
Joined: Tue Jan 20, 2004 11:19 am

Post by /\ndy »

many thanks, works a treat now.
Post Reply