Jump to content

[SOLVED] Does this small isset make sense?


s1yman

Recommended Posts

No, you need to use isset() on both variables:

<?php
if(isset($_POST['div7']) && isset($_POST['div8'])) {
    echo 'Both $_POST[\'div7\'] and $_POST[\'div8\'] is set.';
}
?>

 

Although, your example may actually work, as I believe the above is actually the same as:

<?php
if($_POST['div7'] && $_POST['div8']) {
    echo 'Both $_POST[\'div7\'] and $_POST[\'div8\'] is set.';
}
?>

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.