Jump to content

Ignore some variables? (fwrite)


nothing4me

Recommended Posts

Ok, I'm trying to make a script that will make another script that has configuration information.

 

For example:

<?php
$File = "config.php";
$Handle = fopen($File, 'a');
$Data = "<?php
$host['naam'] = '*****';                // my host
$host['gebruikersnaam'] = '*****';       // my database username
$host['wachtwoord'] = '*****';   // my database password
$host['databasenaam'] = '*****';       // my database name
$db = mysql_pconnect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
mysql_select_db($host['databasenaam'], $db);";
fwrite($Handle, $Data);
print "Complete!";
fclose($Handle);
?>

 

So it will create config.php and enter that information. I do not want $host['naam'], $host['gebruikersnaam'], $host['wachtwoord'], or $host['databasenaam'] acting as a variable. I want it to simple just enter that as text.

But, I want the ***** to act like variables, so when I create one, it'll go there.

 

Any help? :)

Link to comment
https://forums.phpfreaks.com/topic/113450-ignore-some-variables-fwrite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.