emediastudios Posted October 1, 2007 Share Posted October 1, 2007 I want to check to see if there is a empty form varible sent. I have this code <?php if (isset($_POST['what do i put in here if i want to check if posted data is nothing'])) { echo "N/A"; } else { echo "<a href='images/".$_POST['photo2']."' target='_blank'><img src='images/".$_POST['photo2']."' alt='image' width='150' border='0' /></a>"; } ?> Link to comment https://forums.phpfreaks.com/topic/71342-solved-qiuick-easy-one-i-hope/ Share on other sites More sharing options...
marcus Posted October 1, 2007 Share Posted October 1, 2007 if($_POST['form_variable']){ echo "exists"; }else { echo "doesn't exist"; } Link to comment https://forums.phpfreaks.com/topic/71342-solved-qiuick-easy-one-i-hope/#findComment-358949 Share on other sites More sharing options...
dingus Posted October 1, 2007 Share Posted October 1, 2007 you would put in the name of the field if you have <input type="text" name="name"> you would put if (isset($_POST['name'])) { echo "N/A"; } Link to comment https://forums.phpfreaks.com/topic/71342-solved-qiuick-easy-one-i-hope/#findComment-358951 Share on other sites More sharing options...
emediastudios Posted October 1, 2007 Author Share Posted October 1, 2007 Seems strange but i used this code and it works, Reversed it <?php if (!empty($_POST['photo2'])) { echo "<a href='images/".$_POST['photo2']."' target='_blank'><img src='images/".$_POST['photo2']."' alt='image' width='150' border='0' /></a>"; } else { echo ""; } ?> Link to comment https://forums.phpfreaks.com/topic/71342-solved-qiuick-easy-one-i-hope/#findComment-358967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.