I have slight problem in my code. I’m supposed to call a function in another function in my php script. However the two function are in different scripts. I’m trying to run the scripts and they’re just throwing errors. Here’s a sample of how I’m writing my scripts. The first script is confirmLib.php
<?php
class confirmClass{
function confirm()
{
return true;
}
}?>
The second is usersLib.php
<?php
require("confirmLib.php");
class user
{
var $confirmed= null;
}
public addUser(){
$comfirmUser = new confirmClass();
$confirmed = $comfirmUser->confirm()
}
addUser();
?>
You’ve got plenty of basic errors, why not just bugfix?
This
}shouldn’t be there. it closes the class.You’r missing the keyword “function”
You’re missing a
;What is this doing here? You should close your class here, and then add a
new usercall and auser->addUser()call too.