Salary Percentage in PHP

<!DOCTYPE html>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<form action=”index.php” method=”post”>
<table cellpadding=”5″ cellspacing=”5″>
<td><input type=”text” name=”txtSalary”></td>
<td><input type=”submit” name=”ShowSalary”></td>
<table cellpadding=”5″ cellspacing=”5″>
<tr bgcolor=”#6699FF”><th>Expences</th><th>Percentage</th><th>Cost</th></tr>
$Salary = $_POST[‘txtSalary’];
$Home = $Salary*0.10;
$Rashan = $Salary*0.10;
$Medical = $Salary*0.5;
$Travel = $Salary*0.5;
$Education = $Salary*0.5;
$Remaining = $Salary*0.60;

$CN = mysql_connect(“LocalHost”,”root”,””);
mysql_query(“insert into tblSalary values (”,’$Salary’,’$Home’,’$Rashan’,’$Medical’,’$Travel’,’$Education’,’$Remaining’)”,$CN);

echo”<tr><td>Total</td> <td>100$</td> <td>$Salary. Rs</td></tr>”;
echo”<tr><td>House Rent</td> <td>10%</td> <td>$Home. Rs</td></tr>”;
echo”<tr><td>Rashan</td> <td>10%</td> <td>$Rashan. Rs</td></tr>”;
echo”<tr><td>Medical</td> <td>5%</td> <td>$Medical. Rs</td></tr>”;
echo”<tr><td>Travel</td> <td>5%</td> <td>$Travel. Rs</td></tr>”;
echo”<tr><td>Education</td> <td>5%</td> <td>$Education. Rs</td></tr>”;
echo”<tr><td>Remaining</td> <td>60%</td> <td>$Remaining. Rs</td></tr>”;


Table import it in phpmyadmin tblsalary


It's Great To Hear From You

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s