Is there a way to create and save a PHP file using code? I would like to create a database connection file on the fly when building the database, so would want to create a file called dbconnect.php, fill it with the database connection details such as 'username' etc from my script
the final format I would want is
<?php
$dbhostname = "localhost";
$dbdatabase = "MY VARIABLE HERE";
$dbusername = "private";
$dbpassword = "private";
$fgconnection = mysql_pconnect($dbhostname, $dbusername, $dbpassword) or die(mysql_error());
@mysql_select_db($dbdatabase) or die("Database error (error 1)");
Bookmarks