unemployment Posted January 24, 2011 Share Posted January 24, 2011 I get an undefined constant error message. Am I using the variable correctly? Should I use an echo to output the variable as text? Added by <?php ${displayName}; ?> Link to comment https://forums.phpfreaks.com/topic/225532-undefined-constant/ Share on other sites More sharing options...
Maq Posted January 24, 2011 Share Posted January 24, 2011 You need the dollar sign directly next to your variable name. It thinks displayName is a constant. If it is, please read the manual: http://php.net/manual/en/function.constant.php Link to comment https://forums.phpfreaks.com/topic/225532-undefined-constant/#findComment-1164552 Share on other sites More sharing options...
btherl Posted January 25, 2011 Share Posted January 25, 2011 Are you sure that is the code causing the warning? Yes, you should be using echo. Link to comment https://forums.phpfreaks.com/topic/225532-undefined-constant/#findComment-1164839 Share on other sites More sharing options...
unemployment Posted January 25, 2011 Author Share Posted January 25, 2011 I think I just wasn't passing the variable through correctly. Problem solved. Link to comment https://forums.phpfreaks.com/topic/225532-undefined-constant/#findComment-1164848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.