Hi all,
Is there any reason why the following code wont work?
<?php
$user = 'user';
$pass = 'pass';
function test() {
global $user, $pass;
return $user.$pass;
}
echo test();
?>
I am using this in a snippet, and it doesn’t do anything yet if I pass $user and $pass as a variable it will work:
ie
<?php
$user = 'user';
$pass = 'pass';
function test($user, $pass) {
return $user.$pass;
}
echo test($user, $pass);
?>
Am I missing something?
Also, is there anyway you can get the username and password used to connect to the mysql database? I am currently having to manually type in the same database details as those used for modx.
Cheers