[SOLVED]PHP misbehaving?

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
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

[SOLVED]PHP misbehaving?

Post by evilmonkey »

Weirdest error I have EVER seen: I have a very small page with some PHP and some HTML. Very straighforward, here it is:

Code: Select all

<?php
include("functions.php");
include("user_class.php");
$user = new User($_GET['id']); //id passed
$about_self = smilie($user->about_self);
?>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-color: #cccccc;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
    line-height: 16px;
}
-->
</style></head>

<body>
<table width="342" height="18" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"> <span class="style1"><?php echo $about_self; ?></p></td>
  </tr>
</table>
</body>
</html>
And this is the error it spits out:

Code: Select all

Fatal error: Call to undefined function: phpinclude() in /home/vlad/public_html/aboutme.php on line 1
Any ideas on what can be causing it?

Thanks. :)
Last edited by evilmonkey on Sat Mar 18, 2006 2:49 pm, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

For somereason php is trying to call:

Code: Select all

phpinclude("functions.php");

add a couple spaces before your include:

Code: Select all

<?php     include("functions.php");
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

might be a binary character that's screwing with php after <?php
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Hmmm....I added a few spaces after <?php, now ther's no output....
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

is there anything before?


check for hidden characters in notepad.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

I'd suggest creating a NEW file with the following in it, and then overwriting the previous file.

Code: Select all

<?php
include("functions.php");
include("user_class.php");
$user = new User($_GET['id']); //id passed
$about_self = smilie($user->about_self);
?>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #cccccc;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
.style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;
    line-height: 16px;
}
-->
</style></head>

<body>
<table width="342" height="18" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"> <span class="style1"><?php echo $about_self; ?></p></td>
  </tr>
</table>
</body>
</html>
User avatar
sp2hari
Forum Newbie
Posts: 14
Joined: Fri Jan 13, 2006 3:54 am

Post by sp2hari »

try having include in this way

Code: Select all

include "functions.php";
i.e remove the () in the include

i am not sure whether this will work but it is worth trying
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Hello,

Sorry, I've been away for a couple of days. I solved the problem by creating a new file, as d3ad1ysp0rk said...really weird stuff though...

Thanks everyone. :)
Post Reply