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 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 : ''; ?> 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; 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..... 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. Link to comment https://forums.phpfreaks.com/topic/258247-please-help-echoing-constant/#findComment-1323753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.