You would generally want the functions in email.php to be oblivious to which config.php file you include, but in principle you are correct in your assumptions.
Why don’t you try it and test everything get wired up together as you would expect?
Here is something to get you started:
config.php
<?php
$my_email_address="myemail.gmail.com";
?>
email.php
<?php
function sendEmail($address){
return "<p>I am now sending an email to $address</p>";
}
?>
order.php
<?php
include_once 'config.php';
include_once 'email.php';
echo '<h3>wow, I got an order!</h3>';
$clients_email_address = $_GET['client'];
sendEmail($my_email_address);
sendEmail($clients_email_address);
?>
For the time being to prove the theory put all the files in the same folder and test with:
and if everything is wired up correctly, ie order will accept includes from the same folder, it should come out with the proof you need.
The example above is:
-Untested
-Insecure
-Not robust
-Pre-supposes that includes will be included from the same folder as your calling script (order.php).
but should answer your question, else reply with errors or further questions.