pouncer Posted November 24, 2006 Share Posted November 24, 2006 Fatal error: Call to a member function on a non-object in c:\domains\mysite.com\wwwroot\myftpname\php_classes\class_registration.php on line 89line 89/90 is[code=php:0]$msg = $func->RegistrationMessage($Username);$func->SendPrivateMessage("John", $Username, "Welcome to Collectors Unite!", $msg);[/code]at the top of class_registration.php i have require_once('php_classes/class_functions.php'); $func = new Functions();and in class_functions.php i have[code=php:0]<?php require_once("php_classes/class_db.php"); DB::Connect(); class Functions { // Send a private message to a user. function SendPrivateMessage($From_, $To_, $Subject, $Message) { $privmessage = mysql_query("INSERT INTO private_messages (From_, To_, Subject, Message, Date_Sent) VALUES('$From_', '$To_', '$Subject', '$Message', now())") or die (mysql_error()); } function RegistrationMessage($Username) { return "Welcome to Collectors Unite $Username.<br>"; } }?>[/code] Quote Link to comment Share on other sites More sharing options...
printf Posted November 24, 2006 Share Posted November 24, 2006 Are this being used inside class [b]registration[/b]?[code]$msg = $func->RegistrationMessage($Username);$func->SendPrivateMessage("John", $Username, "Welcome to Collectors Unite!", $msg);[/code]printf Quote Link to comment Share on other sites More sharing options...
pouncer Posted November 24, 2006 Author Share Posted November 24, 2006 my class registration is like this[code=php:0]<?php require_once('php_classes/class_db.php'); require_once('php_classes/class_functions.php'); DB::Connect(); $func = new Functions(); class Registration { //functions here codes here etc }?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.