How can i use a php form to replace text in a file?

jamison m

New member
for example i have a simple database connection script like this:

<?
/*--------- DATABASE CONNECTION INFO---------*/
$hostname="localhost";
$mysql_login="myusername";
$mysql_password="mypassword";
$database="mydatabase";

// connect to the database server
if (!($db = mysql_pconnect($hostname, $mysql_login , $mysql_password))){
die("Can't connect to database server.");
}else{
// select a database
if (!(mysql_select_db("$database",$db))){
die("Can't connect to database.");
}
}
?>


i am trying to use a form for input to change the log in variables so i wouldnt always have to open the file locally. any help would be greatly appreciated!
 
Back
Top