Can someone help me?
I have a script that I’ve put together from several different scripts. They all access a config.php file to connect to database, but one of them requires a couple of paths to certain file locations. I made a install.php file that creates table and also creates the config.php file I want to incorporate the file locations into the config.php file so there is only one config file for all scripts. It works till I get to the section that I need to add paths at.
Starting at
fwrite($fp, "\t\$changepassword =\"security/chgpwd.php";\n");
fwrite($fp, "\t\$login = "http://" . $SERVER['HTTP_HOST'] . "/security/login.php";\n");
fwrite($fp, "\t\$logout = "http://" . $SERVER['HTTP_HOST'] . "/security/logout.php";\n");
The first fwrite is something I tried “didn’t work” the others are copied right from the original config.php file they came from and they don’t work
fwrite($fp, "<?php\n");
fwrite($fp, "\t\$dbServer=\"$dbServer\";\n");
fwrite($fp, "\t\$dbUsername=\"$dbUsername\";\n");
fwrite($fp, "\t\$dbPassword=\"$dbPassword\";\n");
fwrite($fp, "\t\$dbDatabase=\"$dbDatabase\";\n");
fwrite($fp, "\t\$changepassword =\"security/chgpwd.php";\n");
fwrite($fp, "\t\$login = "http://" . $_SERVER['HTTP_HOST'] . "/security/login.php";\n");
fwrite($fp, "\t\$logout = "http://" . $_SERVER['HTTP_HOST'] . "/security/logout.php";\n");
fwrite($fp, "?>");
fclose($fp);