lingo5 Posted March 4, 2012 Share Posted March 4, 2012 Hi, I'm trying to echo some error message like this: <?php echo (isset($_GET['failed']))?'.CNT_TXT_MYERRORMESSAGE.''; ?> i know it must be a syntax error....but I'm a newb.... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/ Share on other sites More sharing options...
S3cr3t Posted March 4, 2012 Share Posted March 4, 2012 <?php echo (isset($_GET['failed'])) ? CNT_TXT_MYERRORMESSAGE : ''; ?> Quote Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/#findComment-1323748 Share on other sites More sharing options...
scootstah Posted March 4, 2012 Share Posted March 4, 2012 echo isset($_GET['failed']) ? CTN_TXT_MYERRORMESSAGE : ''; With the ternary operator, it goes condition ? if condition is true : if condition is false; Quote Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/#findComment-1323749 Share on other sites More sharing options...
lingo5 Posted March 4, 2012 Author Share Posted March 4, 2012 Thanks Scootstah...you rule!! i thought I had to use quotes to echo a string..... Quote Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/#findComment-1323750 Share on other sites More sharing options...
scootstah Posted March 4, 2012 Share Posted March 4, 2012 Thanks Scootstah...you rule!! i thought I had to use quotes to echo a string..... You do, but not constants. Quote Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/#findComment-1323753 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.