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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -