Archive for the 'PHP' Category

Changing CSS class through PHP

Its a very simple way of changing css class using php, all you have to do is to run a for loop and each loop it will change the class.

Changing CSS class through PHP

First we define css classes as gray blue green and black, and we’ll use it in table using php.

<html>
<title>Changing CSS class through PHP - Demo</title>
<head>
<style>

.gray{background-color:red; color:white;font-size:20px; font-weight:bold; }
.blue{background-color:blue; color:white;font-size:20px; font-weight:bold; }
.green{background-color:green; color:white;font-size:20px; font-weight:bold; }
.black{background-color:black; color:white;font-size:20px; font-weight:bold; }
</style>
</head>
<body>

<table width=”500″ border=”6″ cellspacing=”6″ cellpadding=”6″ >

<?php
for($row=1; $row<=10; $row++)
{ echo “<tr>”;
for($column=1; $column<=4; $column++)
{
switch($column){
case 1: $class=”gray”; break;
case 2: $class=”blue”; break;
case 3: $class=”green”; break;
default: $class=”black”;
}
echo “<td class=\”$class\” align=\”center\”>[$row,$column]</td>”;
}

echo “</tr>”;
}
?>
</table>
</body>

Watch demo

cannot find output from lex; giving up

if you see the above error message while compiling an application from source code ./configure

it means you dont have flex installed on your machine so install it using yum

[root@localhost ~]#yum install flex

and then try to run ./configure command, will work!

Turn Windows Xp into Webserver

Did you ever wish to have Apache, PHP, Mysql, PhpMyadmin, and SQLiteManager on your Xp Desktop or Laptop? Thanks to Wamps Server which make it easy to work all together in one go. Just install wampserver and all these bunch of stuff will be installed and configured automatically so no need to do it manually now.

Here is a easy step by step way using images of how to install and make it work on windows xp.

Installing Wampserver

download wampserver from http://www.wampserver.com/en/download.php and open the file. The following images will guide you the step by step way of installing wampserver. Click on Next when the first screen appears.

Read the rest of this entry »