ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
Re: [PHP-DB] Text file (rw) question...
by Chris other posts by this author
Mar 14 2006 5:16PM messages near this date
Re: [PHP-DB] Text file (rw) question... | Re: [PHP-DB] Text file (rw) question...
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
Thread:
Rob W.
Rob W.
Chris
Rob W.
Rob W.
Rob W.
Chris
Rob W.
Chris
Rob W.
Chris
Rob W.
Chris
Peter Beckman
Rob W.
Chris
Dwight Altman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved