Page 1 of 1

[SOLVED]PHP misbehaving?

Posted: Tue Mar 14, 2006 7:17 pm
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. :)

Posted: Tue Mar 14, 2006 7:25 pm
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");

Posted: Tue Mar 14, 2006 7:30 pm
by feyd
might be a binary character that's screwing with php after <?php

Posted: Tue Mar 14, 2006 8:01 pm
by evilmonkey
Hmmm....I added a few spaces after <?php, now ther's no output....

Posted: Tue Mar 14, 2006 9:09 pm
by nickman013
is there anything before?


check for hidden characters in notepad.

Posted: Tue Mar 14, 2006 9:12 pm
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>

Posted: Wed Mar 15, 2006 3:34 am
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

Posted: Sat Mar 18, 2006 2:44 pm
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. :)