Can any body please tell me how can i add a PHP code which has HTML tages included in it to javascript function?
function initial()
{
<?
$sql1 = "SELECT chat_user_id,chat_user_id1,chat_user_name,Message FROM chat_table WHERE chat_user_id=".$SESSION['Chat_UserID']." and chat_flag='".$flag10."'";
$res1 = mysql_query($sql1);
if(mysql_num_rows($res1))
{
echo '<div id="contents">';
while($row1 = mysql_fetch_array($res1))
{
if($row1['chat_user_id']==$SESSION['Chat_UserID'])
echo '<div class="ylayout-active-content" style="font-size:14px;font-face:arial;"><strong>'.htmlspecialchars($row1['chat_user_name']).':</strong>'.htmlspecialchars($row1['Message']).'</div>';
}
echo '</div>';
}?>
}
Is it possible to do that one. since it gives me the syntax error after running.
Mandar 😕