php - How to avoid the error while I haven't click submit -
i have giving declare value going use later on button
$dstart = $_post["dstart"]; $dend = $_post["dend"];
but when didn't click submit button show me error
undefined variable: dstart in c:\.....
how can avoid error without using
error_reporting(0);
if (isset($_post['dstart'])){ $dstart = $_post['dstart']; } if (isset($_post['dend'])){ $dend = $_post['dend']; }
with magic of isset
if somewhere using echo $_post['dstart'];
should modify:
if (isset($_post['dstart'])){ echo $_post['dstart']; }
Comments
Post a Comment