Classes / OOP Programming error
Posted: Wed Jun 26, 2002 11:52 am
I get this error from my that it cant find this once function, but others i call before it are fine. The error is:
the particular line of error is:
I have no idea whats going wrong, bec the other class calls are fine. Im using Apache 1.32.24, and Php 4.3.0dev
Thanks for anytype of help.
The code for testnews:Fatal error: Call to a member function on a non-object in c:\apache\apache\htdocs\testnews.php on line 41
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="502" cellspacing="0" cellpadding="0" align="center" border="1" bordercolor="#000000">
<tr>
<td width="500" bordercolor="#000000" bgcolor="#6699CC">
<blockquote>
<?php
include_once("news_sys.php");
#news_sys = new news_sys;
switch( $p )
{
case "comment":
$news_sys->GetComments($ID);
echo"
<form name="form1" method="post" action="$PHP_SELF?p=add">
<p><font face="Tahoma" size="2" color="#000000">Subject:
<input type="text" name="subject" value="Re: $subject">
<br>
Comments:
<textarea name="comments" cols="25"></textarea>
<input type="hidden" name="ID" value="$ID">
</font></p>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>
";
break;
case "add":
$news_sys->InsertComment( $subject, $comments, $ID );
$subject = $comments = $ID = "";
break;
default:
$news_sys->GetNews(15);
break;
}
?>
</blockquote>
</td>
</tr>
</table>
</body>
</html>Code: Select all
$news_sys->GetNews(15);Thanks for anytype of help.