ADDING TO FILES *THIS NOOB NEEDS HELP*
Posted: Mon Jul 15, 2002 8:15 pm
Im making an install script for a AOL Instant messanger Guestbook that i made.. I got it to write in the config.php because all that needs to be there is this:
<?
$dbhost = "localhost" ;
$databees = "database" ;
$dbusername = "username" ;
$dbpassword = "pass"
?>
Ok, now on the actual page needed to view it i have to have more code than that. but when i use the same code, the only code i know to do this, it erases everything and just pastes that info into it.
I dont want it to erase everything just add that info to it.
To get it to write in the config.php i am using this script.
$fp = fopen ("config.php", "w+");
fwrite($fp, "<?\n ");
fwrite($fp, $hoststring);
fwrite($fp, $databasestring);
fwrite($fp, $dbusernamestring);
fwrite($fp, $dbpasswordstring);
fwrite($fp, "?>");
fclose($fp);
Im stupid when it comes to php so please help. Thanks.
<?
$dbhost = "localhost" ;
$databees = "database" ;
$dbusername = "username" ;
$dbpassword = "pass"
?>
Ok, now on the actual page needed to view it i have to have more code than that. but when i use the same code, the only code i know to do this, it erases everything and just pastes that info into it.
I dont want it to erase everything just add that info to it.
To get it to write in the config.php i am using this script.
$fp = fopen ("config.php", "w+");
fwrite($fp, "<?\n ");
fwrite($fp, $hoststring);
fwrite($fp, $databasestring);
fwrite($fp, $dbusernamestring);
fwrite($fp, $dbpasswordstring);
fwrite($fp, "?>");
fclose($fp);
Im stupid when it comes to php so please help. Thanks.