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'];   } 

http://uk1.php.net/isset

with magic of isset

if somewhere using echo $_post['dstart'];
should modify:

if (isset($_post['dstart'])){ echo $_post['dstart']; } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -