Re: IF ( $_POST['submit'] == "Update Subscriptions" OR $_POST['submit'] == "Update Entire Account" ) {

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

 



Ron wrote:

> I am stuck again.  If on the admin screen someone clicks "UPDATE
> ADDRESS" the address change is saved.  BUT if I try to do an address
> change and then click "UPDATE ENTIRE ACCOUNT" the address change isn't
> saved.  

logical. It is not well structured.

When clicking "UPDATE ADDRESS" you are accomplishing the second IF.

When you click "UPDATE ENTIRE ACCOUNT", you are accomplishing the
first IF and here it's the end of your process. You cannot expect
more things than those present inside this first IF.

As Bastien Koert wrote, it would be better only one button,
You can show all the actual dates to the user:

    <form ...>
    <input value="<? echo $row['phone'];?>">
    <input value="<? echo $row['address'];?>">
etc...
    <input type="submit"...>
    </form>

when users changes any of them, after clicking on submit button
also the rest of unchanged data will be saved.
In this way you only need one condition:

if ($_POST['submit'] == "Update Entire Account") {
   // UPDATE all fields
}


best regards,

-- 
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