Jump to content

isset help


Clinton

Recommended Posts

Ok, Premiso... I did not enter anything into that line (dtypewc) so why did it "set"? How does something "set"? I looked up in the manual but it doesn't say how a variable set's.

 

 

Thanks for the empty link btw.

 

How is $dtypewc being populated?

 

If it is from a form, chances are register_globals is on and I would suggest turning them off or coding like they are off.

 

Basically register_globals converts and form/session/cookie data to an actual string. So a form with a field name of dtypewc will out populate $dtypewc, when you should do something like this to assign the variable...

 

<?php
$dtypewc = (isset($_REQUEST['dtypewc']) && !empty($_REQUEST['dtypewc']))?$_REQUEST['dtypewc']:false;
?>

 

Then your if would be

<?php 
$dtypewc = (isset($_REQUEST['dtypewc']) && !empty($_REQUEST['dtypewc']))?$_REQUEST['dtypewc']:null;

if (!is_null($dtypewc))
{ ?>
      <tr><td id='header'>
      Will Consider a <?php echo $dtypewc; ?>.
      </td></tr>
<?php }    ?>

 

That is assuming that is what is happening.

Link to comment
Share on other sites

It's an option on a form, text type, then the form INSERTS all info into the db.

 

It's actually being populated by SELECT then extract_row().

 

Then it is coming out of the DB it has a value of "" so the variable is created, meaning it was set, thus why you would need to check empty to check if that value has any data or not.

 

You could even remove the isset if you wanted to and just check the empty.

Link to comment
Share on other sites

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.