开发者

Form field input empty than do not update

开发者 https://www.devze.com 2023-03-17 12:18 出处:网络
I have a form that updates a user\'s info.How can I开发者_开发百科 tell the form to NOT update certain fields when left blank?

I have a form that updates a user's info. How can I开发者_开发百科 tell the form to NOT update certain fields when left blank?

if(trim($email) == '') { /* don't update */ }


This is better:

if ( empty( trim( $email ) ) )
{
    // do not update
}
else
{
    // update
    ...
}


if(trim($email) == '') {}else{ YOUR UPDATE SCRIPT HERE }
0

精彩评论

暂无评论...
验证码 换一张
取 消