uglyjay Posted January 25, 2008 Share Posted January 25, 2008 Hello guys/gals, I am stump! I would like me mail form to only email the text field contents if data is entered in it. I used this statement: if ( isset($_POST['location']) ) { $message .= 'Location' . $_POST['location']; } This works, but not as disired. If text is not entered in the text field, the 'Location' Lable is still being displayed. Is there a way I can make them visible only if data is entered in the text field? Link to comment https://forums.phpfreaks.com/topic/87765-email-form/ Share on other sites More sharing options...
revraz Posted January 25, 2008 Share Posted January 25, 2008 Don't check with ISSET, check to see if it contains data or a length greater than 0. Link to comment https://forums.phpfreaks.com/topic/87765-email-form/#findComment-448930 Share on other sites More sharing options...
uglyjay Posted January 25, 2008 Author Share Posted January 25, 2008 I would like a label attached with the text field as well. Can you help me implement this to my code? Link to comment https://forums.phpfreaks.com/topic/87765-email-form/#findComment-448941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.