Page 1 of 1

how to check if a variable exists

Posted: Sun Jul 09, 2006 3:14 am
by HomerTheDragoon
how do I do this?

Also what happens if i assign a varrible $POST_['variable'] and there wasnt a varible sent.

Posted: Sun Jul 09, 2006 3:39 am
by Benjamin

Code: Select all

<?php
if (!isset($_POST['variable'])) {
    echo 'Not Set!';
} else {
    echo 'Set! Yay!!!';
}
?>