Hi Everyone
im currently creating an install script and i was hoping to touch and cat to a lot of files for them to be created, but im having troubles.
You will easily see in the code below what im trying to achieve.
//Lets create the mysqli_connection page for all other php pages to use with the new DB user
exec ('touch database/mysqli_connection.php');
exec ('echo "<?php
$mysqli_connection = mysqli_connect('.$servername.','. $dbnewuser.','. $newuserpass.','. $dbname.');
if (!$mysqli_connection){
die("Connection Failed: " . mysqli_connect_error());
}
?>" > database/mysqli_connection.php');
the issue I have is this is how the file comes out, its having trouble passing $mysqli_connection as a string.
see the mysqli_connection.php below
<?php
= mysqli_connect(localhost,testuser,testPassword,testDB);
if (!){
die(Connection Failed: . mysqli_connect_error());
}
?>
I did try using single quotes around the $mysqli_connection variable like so
'.$mysqli_connection.' but the file then comes out blank.
any help given would be greatly appreciated, and i thank everyone for their help in advance