Hey,
Alright, here's the deal folks, I'm new to PHP so I don't know exactly how the hierarchy works with this language, but what I'd like to know is whether or not (and how) it were possible for a child file (since I'm not talking about classes here...) to access variables in it's mother file. Ok, yes, I'm aware that this probably makes no sense sine my terminology is class based (for Java and stuff).
So now that I've confused you, I'll try to explain what I'm trying to do:
/*Inside login.php*/
//The user has to log in putting in a username and password every time the file is run, but here I have just made the username equal to a string with my name.
$usrName="Khael";
/*Inside index.php*/
import 'login.php';
import 'stuff.php';
$pageContent=$stuff;
echo pageContent;
/*Inside stuff.php*/
$stuff = "
<html>
<head></head>
<body>
<table>
<tr>
<td>Blahahahaha posted by $usrName<td>
</tr>
</table>
</body>
</html>";
//I need to get $usrName into this file without importing login.php, because I don't want to have to log in again.
If anybody has an idea, I'm all ears 😛
Thanks in advance,
-Khael