Jump to content

Recommended Posts

  if ($pt_name !== ""){
  $came = "This came from consult list";
  	  }
	  else {
	  $came = "";
	  }

 

Thanks that works but now even if pt_name is blank, I get $came = "This came from consult list";

Why is it not going to the else statement even when pt is blank?

you're not telling it what to do .. for instance, are you asking for the string length to be checked?  or if the string is set or not?  or if it's empty?

 

any one of the following will suffice .. isset() is most common.

 

if (isset ($pt_name))
{
     $came = "This came from consult list";
}
else {
     $came = "not set";
}

 

or...

 

if (strlen($pt_name) > 0)
{
     $came = "This came from consult list";
}
else {
     $came = "no value present";
}

Thanks the !empty solution worked.

To mrMarcus:  After that code, later on I have this statement:

 

 

<textarea name="comments" id="comments" cols="50" rows="4" ><?php echo $came;?></textarea>

what's wrong with the textarea?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.