Re: Text file (rw) question...

From: Date: Wed, 15 Mar 2006 01:14:44 +0000
Subject: Re: Text file (rw) question...
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.db 
Request: Send a blank email to php-db+get-41504@lists.php.net to get a copy of this message
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/

« previous php.db (#41504) next »