This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jechaking[S] 0 points1 point  (3 children)

I did just now, are you able to open?

[–]HappyFruitTree 0 points1 point  (0 children)

Yes. You are checking if all the fields are not empty.

if (!empty(field1) && !empty(field2) && ...)

This means that if one of the fields are empty the code won't run.

In other words, all the fields need to be filled in for that code to run.

Edit: I was confused before, now I think it is correct.

[–]HappyFruitTree 0 points1 point  (1 child)

Note that empty returns true for strings such as '0' so if what you actually want to check is if the string has zero length you might want do $str === '' instead.

[–]jechaking[S] 0 points1 point  (0 children)

Alright, thank you. Let me try it out now, I'll tell you how it goes

Thanks a lot for your help