Hi All,

I want to know how to write a php script that run in background in browser when anyone login.

Hi All,
I am developing a fee management system in which i want to view unpaid fee of students. Can any one guide me how to to do this in php. I need a logic. Please guide me.

<?php
include('config.php');
@session_start();
@$sessionName = $_SESSION['NAME'];
$date = date('d-m-y');
$loc = $_POST['locationID'];
@$name = $_POST['name'];
$status = $_POST['status'];
$class = $_POST['class'];
$section = $_POST['section'];
$i = 0;
while($i<count($loc)){
        $fname = mysql_real_escape_string($name[$i]);
        $sts = mysql_real_escape_string($status[$i]);
        $cls = mysql_real_escape_string($class[$i]);
        $sec = mysql_real_escape_string($section[$i]);
    $query = "INSERT INTO tbl_attendence ( 
       fld_studentname, fld_status, fld_class,fld_section,fld_date,fld_takenby)

        VALUES (
        '$fname',
        '$sts',
        '$cls',
        '$sec',
        '$date',
        '$sessionName'
            )
        "; 
    mysql_query($query);          
    $i++;  
}
if(mysql_affected_rows()>0){
    echo "Attendance Updated Successfully";
} else {
    echo "There was an error updating attendance.please contact with server admin or try again";
    echo "<br><br>Error: " . mysql_error();
    echo "<br><br>Query: " . $query;
} 
?>

Hi Maruff, I am not getting any value it is shwoing blank. Please guide me.

hi maruf22,

i am getting no values, however in $status , it is saving P,r,e as loop is running three time. Please help me Maruf..