September 1st, 2000, 07:27 PM
Alex Greg isn't online Okay I need some help.
I want the user to have some setup options such as changing the name variable, emal varable, among other things in an online format.
I am not using MySQL with this script.
So what I was thinking was the following, where $name and $email are the name and email variables, and $enter_name and $enter_email are the user input to change these values in variables.txt:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
$fp = fopen($file, "r+");
$write_to_file = "write the excact same code as in variables.txt except change each value to the users input";
What I mean (the description you see of $write_to_file) is I want it to rewrite variables.txt with the new input.
So, How can I write PHP code in a variable?
September 2nd, 2000, 06:25 AM
$results = file($list);
while (list(,$path) = each($results))
$parts = explode(':', $path);
$path = $parts;
$fp = fopen("$list", 'r');
$data = fread($fp, filesize($list));
$newdata =eregi_replace($email, $enter_email, $data);
$fp = fopen($list, 'w');
return(" <br>Occurences of $email replaced with $enter_email");
Try calling this functions twice, once for changing name and once for email or modify a bit to do both at a go. This function accepts filename the old word to replace and the new word to be replaced with and modifies the file.
Best Of luck then and mail in case it work or any problems regarding it.
** Expertise comes with experiece ** Nikunj