PDA

View Full Version : preg_match and preg_replace problem



utsav
July 12th, 2008, 02:15 PM
Well i'll try and explain my problem in as detail as possible. Here it goes.

I have a config.php file that has variables stored in it as

<?php
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "abc";
?>

Now i have another php file with 4 textboxes each for a variable in config.php file.

What i want to do is on click of the save button on this page. I want textbox1 value to replace localhost , textbox2 value to replace root , and on.... ,I know i need to use preg_match and preg_replace. but dont know how ?? So a fully explained help with codes would be helpfull so as i could see and learn.

Thanks!!!!