Hello,
I am trying to create a folder using the variable $CompanyID and it actually creates a folder called $CompanyID instead of the value for $CompanyID.
Here is my code:
//a bunch of variables defined here including:
$CompanyID = $id; //$id is a variable in the url
//a bunch of database creations here
//Creation of new folders based on companies id
$oldumask = umask(0);
mkdir('../$CompanyID', 0777); // or even 01777 so you get the sticky bit set
mkdir('../$CompanyID/bol', 0777);
mkdir('../$CompanyID/inventory', 0777);
mkdir('../$CompanyID/employee', 0777);
mkdir('../$CompanyID/customer', 0777);
mkdir('../$CompanyID/payroll', 0777);
mkdir('../$CompanyID/finance', 0777);
umask($oldumask);
//end creation of directories
I know that my $id variable is correct because before the mkdir function I create several databases based off that id.
example (if id is 15485)
//sql-code is psuedo code for this thread, but actual code in my script
$profile = $id . "Profile";
mysql_query(CREATE TABLE $profile blah blah blah) or die (mysql_error());
This actually creates the table 15485Profile like it should, so I know my $id is correct.
Any ideas would be appreciated.
Thanks,
Johnie Karr