Welcome Guest, Not a member yet? Register   Sign In
Form Validation - Requiring one input OR the other
#4

[eluser]gstjohn[/eluser]
Small note: empty() cannot check the return value of a function or method.

Code:
if (empty($this->input->post('zipcode'))) { ... }

You will get an error saying:

Quote:Fatal error: Can't use method return value in write context in ...

Corrected syntax will need to be:

Code:
$zipcode = $this->input->post('zipcode');
if (empty($zipcode)) { ... }


Messages In This Thread
Form Validation - Requiring one input OR the other - by El Forum - 12-11-2008, 05:38 PM
Form Validation - Requiring one input OR the other - by El Forum - 12-12-2008, 12:15 AM
Form Validation - Requiring one input OR the other - by El Forum - 12-12-2008, 12:57 AM
Form Validation - Requiring one input OR the other - by El Forum - 12-12-2008, 02:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB