Error executing function in another file [closed]

-3

Inside the file insert.php I have a function that validates the sending to the bank and then after sending a return email, the problem that when marking the file send.php that will execute the code of the following error. / p>

Fatal error: Call to undefined method email :: envioemail () in

Follows:

insert.php

include("envia.php");
$envia=new email();
$envia->envioemail();

envio.php

class email {
function enviaemail() {
    
asked by anonymous 13.07.2016 / 16:38

1 answer

2

There are some errors in the code. It should look something like this: File structure

SeuProjeto  
|--inserir.php 
|--class //folder
|-------Envio.php

With this your code would look like this:
insert.php

include("class/Envio.php");
$envia = new email();
$envia->envioemail();

Shipping.php

class email 
{
   function envioemail() 
   {
     //SUA FUNÇÃO AQUI
   }
}

I hope I have helped.

    
13.07.2016 / 17:38