bulgaria_mitko Posted December 13, 2006 Share Posted December 13, 2006 i have this code:[code]<?phpif ($ime != TRUE) { echo $_POST['ime'];} else { echo "<i>Моля, въведете Вашето име!</i>";}?>[/code]trying to display the $ime witch in english is $name and when someone write a name it displays it, but when nothing is written and is clicked on submit it suppossed to show this text: "Моля, въведете Вашето име!" (witch means that the user didnt enter a name), but when i user didnt enter a name and click on submit it dosent show anything, what i mean by that is that i suppose it is FALSE and thats why it is 0 but the 0 is not displayed and it is displaying "" (nothing), not an error and also not the messege, nothing. So can someone tell me where is my mistake? thank you! Link to comment https://forums.phpfreaks.com/topic/30474-if-else-statement-a-small-question/ Share on other sites More sharing options...
kayess2004 Posted December 13, 2006 Share Posted December 13, 2006 Hi,Give this a try,[code]<?phpif (isset($_POST['ime']) && $_POST['ime'] != '') { echo $_POST['ime'];} else { echo "<i>Моля, въведете Вашето име!</i>";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/30474-if-else-statement-a-small-question/#findComment-140318 Share on other sites More sharing options...
bulgaria_mitko Posted December 13, 2006 Author Share Posted December 13, 2006 it worked great thank you! Link to comment https://forums.phpfreaks.com/topic/30474-if-else-statement-a-small-question/#findComment-140343 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.