JTapp Posted May 22, 2008 Share Posted May 22, 2008 Below is my echo line.. I'm wanting the entire line to disappear if the field value is null. Does anybody know if there is a way I can do this? Thanks in advance for your time! echo "<p<b>Meeting Time:</b> $variable16</p>"; Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/ Share on other sites More sharing options...
wildteen88 Posted May 22, 2008 Share Posted May 22, 2008 if(!empty(trim($variable16))) { echo "<pMeeting Time: $variable16</p>"; } You should give your variables meaningful names. Don't let dreamweaver name them for you. Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547494 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 Thanks for the advice. I tried inserting that line and I got a blank page returned..? Any ideas around what I might have done wrong? Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547501 Share on other sites More sharing options...
wildteen88 Posted May 22, 2008 Share Posted May 22, 2008 Turn error reporting on and post the error here. Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547515 Share on other sites More sharing options...
JTapp Posted May 22, 2008 Author Share Posted May 22, 2008 added "or die" after your line and still got a blank page. i'm still learning this stuf.. Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547564 Share on other sites More sharing options...
wildteen88 Posted May 22, 2008 Share Posted May 22, 2008 Add <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); ?> to the top of your script. Rerun the script and errors should be displayed. Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547657 Share on other sites More sharing options...
JTapp Posted May 23, 2008 Author Share Posted May 23, 2008 did'nt work... Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-547816 Share on other sites More sharing options...
CroNiX Posted September 22, 2008 Share Posted September 22, 2008 Missing a > on the paragraph tag. echo "<pMeeting Time: $variable16</p>"; should be echo "<p>Meeting Time: $variable16</p>"; Quote Link to comment https://forums.phpfreaks.com/topic/106806-dreamweaver-8-if-a-field-contains-a-null-value-can-i-completely-hide-it/#findComment-647729 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.