Re: Text file (rw) question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rob W. wrote:
So how do I make it so it just set's the variable's that are sent in the $_POST because i wanna write it so that if the value isnt changed, it wont send the $_POST and wont update the config file..

You can't stop the post because your browser does that not php (well you could stop it with javascript).

You could store the original values in a session and then compare when you post the new values. Take the appropriate action if they are the same/different.

What difference does it make if you rewrite the file with the same values?


and why are you afraid of loops? That will be the easiest way to get everything from the form.


If you only want particular values:

$newconfig = "";

$config_values = array('field1', 'field2');

foreach($config_values as $p => $fieldname) {
  $newconfig .= $fieldname . '=' . $_POST[$fieldname] . "\n";
}

....

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux