Jump to content

how to hide code pieces?


adrianle

Recommended Posts

Thanks for the help.. that defnitely helped with the address question..

 

now, how would I modify this so that if the email field is blank, then the page just skips that line and goes to the next value?

 

Like this? ..

if (!empty($address1) || !empty($address2)) {
  echo "Here they are.... $address1 + $address2";
} else { 
  //do nothing, or display a warning that one is blank.
}

Like this? ..

if (!empty($address1) || !empty($address2)) {
  echo "Here they are.... $address1 + $address2";
} else { 
  //do nothing, or display a warning that one is blank.
}

now, how would I modify this so that if the email field is blank, then the page just skips that line and goes to the next value?

 

if (!isset($_POST['e-mail']) || !empty($_POST['e-mail'])) { 
   $e-mail = $_POST['e-mail'];
}

 

Basically like that, so it'll only list or assign the e-mail variable if it is not empty in the database, if it is empty then it'll skip the code completely.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.