So, I have a problem with my PHP running a command if there are multiple variables. I made a simple version for people to see that I'm trying to fix it easier. I thank everyone in advance who can help :)
<?php if ((isset($finalusername)) && if (isset($finalpassword)) && if (isset($finalemail))) echo "This will save."; ?>
if (isset($finalusername, $finalpassword, $finalemail))
Also see the Ultimate PHP Guide issetandempty .
isset
empty
You do not need to place several in it if.
if
if (isset($finalusername) && isset($finalpassword) && isset($finalemail)) { // ... }
In fact, I would even do it like that ...
if (isset($finalusername, $finalpassword, $finalemail)) { // ... }
, isset() .
, :
if (isset($finalusername, $finalpassword, $finalemail)) { echo "This will save."; }
:
if (isset($var1)) { if (isset($var2)) { // continue for each variables... } }