Print HTML & CSS via PHP -
i have user registration , login form has various error/success messages. trying put error box html code around each error message having bit of difficulty.
the html error box is:
<div class="alert alert-info alert-login"> *error message here* <div>
my php looks this:
$msg = 'login failed';
i have tried following:
$msg = '<div class=\"alert alert-info alert-login\">login failed<br></div>';
however did not work, able shed light why , how able fix this? message showing div styling not. cheers!
since you're using single quotes encapsulate string, don't need escape double ones, use:
$msg = '<div class="alert alert-info alert-login">login failed<br></div>';
more strings , single quotes: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single
Comments
Post a Comment