php - functions gets the value true even when there is no value -
i traing send mail php , wrote this:
<?php function title() { if(isset($_get['title'])) { return true; } else { echo "please write title!"; return false; } } function mess() { if(isset($_get['mess'])) { return true; } else { echo "please write messege!"; return false; } } if(mess() && title()) { mail("guycohen801@gmail.com", $_get['title'], $_get['mess']); echo "the mail has bees send!"; } ?> <form action="ftp_mail.php" method="get"> title: <input type="text" name="title" /> messege: <input type="text" name="mess" /> <input type="submit" value="send" /> </form>
but when doesn't writing on $_get['mess']
, $_get['title']
functions mess()
, title()
gets value true. please help!!
use this
if((isset($_get['mess'])) && ($_get['mess']!=""))
Comments
Post a Comment