|
$domain = $_SERVER['HTTP_HOST'];
//echo $domain;
$vdate=date(Y).'-'.date(m).'-'.date(d);
//echo $vdate;
$ab=session_id();
$ipadd=$_SERVER['REMOTE_ADDR'];
$session=mysql_num_rows(mysql_query("select * from visit where sid='$ab' "));
$chk=mysql_num_rows(mysql_query("select * from visit where hostname='$domain'"));
if($chk==0)
{
$row=mysql_fetch_array(mysql_query("select * from visit_no where hostname='$domain'"));
$sql="insert into visit(number,sid,ipaddress,vdate,hostname) values('$row[start_no]','$ab','$ipadd','$vdate','$row[hostname]')";
mysql_query($sql) or die(mysql_error());
}
//$sql="select * from visit where sid='$ab'";
$no_sno=mysql_fetch_array(mysql_query("select max(sno) from visit where hostname='$domain'"));
//echo $no_sno[0];
$no=mysql_fetch_array(mysql_query("select max(number) from visit where sno='$no_sno[0]'"));
//echo $no[0];
$num1=$no[0]+1;
$num=$num1;
if($session==0)
{
$sql="insert into visit(number,sid,ipaddress,vdate,hostname) values('$num','$ab','$ipadd','$vdate','$domain')";
mysql_query($sql) or die(mysql_error());
}
$visi=mysql_fetch_array(mysql_query("select max(number) from visit where hostname='$domain' and sno='$no_sno[0]'"));
//echo $visi[0];
echo "".$visi[0]."";
?>
|
Indian
Institute of Remote Sensing, National Remote Sensing Centre,
Dept. of Space, Govt. of India
4, Kalidas Road, Dehradun - 248 001 (India) |
FAQs
Feedback |