Sunday, 15 September 2013

php - Syntax Error in concat echo statement and html code -



php - Syntax Error in concat echo statement and html code -

please help me understand syntax of concat next

i want next code within echo understand concate

1--> <div class="alert echo $_request['error_id'];?>"\>

i seek next code getting syntax error there 2 echo..

2--> echo "<div class=\"alert" . echo $_request['error_id']; . "\">";

where error cant it... , i want 2 answer both using single quote , double quote

edit

thank @rizier123 working css not working have apply in calss="alert"

while using next code working fine <div class="alert echo $_request['error_id'];?>"\>

but after applying code not working..only text appear background color not comming nad boarder dissappear below

class name alert shows status of login..

edit

thanks 1 time again forget set space after class name..

you don't need write echo , ; again!

so should work:

//echo double quotes echo "<div class=\"alert" . $_request['error_id'] . "\">"; //echo single quotes echo '<div class="alert' . $_request['error_id'] . '">';

maybe need add together space if class name includes spaces!(..."alert "...)

php html css concatenation

No comments:

Post a Comment