X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   $fillerror 'or' statement? (https://forum.x-cart.com/showthread.php?t=2104)

lesmckeown 03-31-2003 06:50 PM

$fillerror 'or' statement?
 
Hi Guys -

Sorry in advance if this is the dumbest question in the world... :oops:

I want to enter an 'or' argument for checking completion of a form [I want the customers email address OR their phone number, but don't want to mandate both]. Plus I want to mandate a 'body' - a question, comment, whatever...

It looks like a line like:

$fillerror = (empty($contact["email"]) || empty($contact["phone"]) || empty($contact["body"]));

...constructs an 'either' argument - if either email or phone or body is blank, an error message pops up.

I don't know the syntax for "$fillerror = [either phone or email empty] or body empty" - can anyone help?

ps, for future reference, is $fillerror Smarty syntax, or php, or is it something specifically x-cart-y?

Cheers

B00MER 03-31-2003 07:52 PM

Well, you could just make phone optional, email is required no matter what, especially if they are sending you an email... without it the mail wouldn't be sent. ;)

You could do:

Code:

if(empty($contact["email"])) $contact["email"]="someemail@email.com";

But you'll need to remove the javascript client side check on the forms as well as in the $fillerror check.

hth. ;)

lesmckeown 04-01-2003 02:16 AM

Thanks, Boomer - I'll take your advice and keep it simple - I'll just make the phone number optional.


All times are GMT -8. The time now is 04:30 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.