I'm beginner in PHP, and for long have been doing my site in XHTML. Now I want to make a News box and have made PHP code for that function as shown below:
<?php
function pop_boxes($words, $class)
{
$string = "<div $class> $words </div>";
print($string);
}
?>
And here is how I call it as inc.container.php :
<div id="mainarea" style="padding:10;">
<?php
include("$paths/include/inc.main.php");
$words = "Try again";
$class = "pop_window";
//the code are in the below file
include("$paths/include/inc.container.php");
pop_boxes($words, $class);
?>
</div>
and the class in CSS is only configure to have red background as test enviroment, that is:
.pop_window{
border:1px;
background-color:red;
}
It strangely prints "Try again" with no formatting and no <div> box. What is wrong?
Thanks for your help!