For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2007 > Re: [PHP-DB] IF ( $_POST['submit'] == "Update Subscriptions" OR $_POST['sub









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] IF ( $_POST['submit'] == "Update Subscriptions" OR $_POST['sub
Vicente

2007-03-21, 6:58 pm

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,
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com