-1

Hello let's say that I have the following structure in my application .

<?
include('includes/functions.php');
include('includes/classes/login.class.php');

$login = new login();

?>

What I want is inside the login class to call a function that is defined in functions.php . But I can't get it to work.

OptimusCrime
  • 14,662
  • 13
  • 58
  • 96
delmoras
  • 83
  • 8

2 Answers2

0

PHP does not care in which file you have storred what function or class definition. Only namespaces, order or processing and of course where inside classes or functions you have what definitions matter.

Zim84
  • 3,404
  • 2
  • 35
  • 40
0

What you are doing is correct.

Including php-code just adds the content of that file in the file where you execute the include. If this is not working there is something else wrong with your code.

You should close this question and make a new one. Include the content of the files you are including and the errors that are displayed.

OptimusCrime
  • 14,662
  • 13
  • 58
  • 96