ob_start(); session_start(); include("../connection.php"); if ($_POST["username"]!="" && $_POST["password"]!="") { global $con; $com=$con->execute ("select * from admin where status=1 and name like '".$_POST["username"]."' and pwd like '".$_POST["password"]."' and type=2"); if ($com->EOF) { echo ""; } else { if ($com->fields["id"]!="") { $_SESSION["uid"]=$com->fields["id"]; $_SESSION["uname"]=$com->fields["name"]; $_SESSION["utype"]=$com->fields["type"]; if ($_SESSION["REF"]!="") { $ref=$_SESSION["REF"]; $_SESSION["REF"]=""; header("Location: ".$ref); } } } } if ($_GET["action"]=="Logout") { $_SESSION["uid"]=""; $_SESSION["uname"]=""; $_SESSION["utype"]=""; header("Location: ".$SURL."html\index.php"); } ?>
|
|||||||||||||||||||||||||||||
Visitors : ob_start();
$strURL = $_SERVER["PHP_SELF"];
$aryURL = explode( "/",$strURL);
$pagename = $aryURL[count($aryURL)-1];
$count_filename = $dirname."html/counter.txt";
// minimum number of digits to display
$min_digits = 0; // set to 0 to display hits count as is
// location of digit images
$digits_location = $SURL."images/counter/";
// dimensions of digit images in pixels
$digit_width = 12;
$digit_height = 13;
//
// INCREMENT HITS COUNT
//
// open count file for reading only
$count_file = fopen($count_filename, "r");
// get current hits count
$hits_count = fgets($count_file, filesize($count_filename) + 1);
// increment hits count by one
if ($pagename=="index.php") {
$hits_count++;
}
// close count file
fclose($count_file);
// open count file for writing only
$count_file = fopen($count_filename, "w");
// write new hits count to count file
fwrite($count_file, $hits_count);
// close count file
fclose($count_file);
//
// OUTPUT HITS COUNT AS A JPEG IMAGE
//
// get number of digits in hits count
$no_digits = strlen($hits_count);
// use a minimum number of digits to display hits count if necessary
if ($no_digits < $min_digits) {
// get number of zeroes to append to hits count
$no_zeroes = $min_digits - $no_digits;
// append zeroes to hits count
for ($i = 0; $i < $no_zeroes; $i++) {
$hits_count = "0" . $hits_count;
}
// get new number of digits in hits count
$no_digits = $min_digits;
}
// send headers for JPEG image
// create hits count image
$count_image = imagecreate($digit_width * $no_digits, $digit_height);
// add digit images to hits count image
for ($i = 0; $i < $no_digits; $i++) {
// get digit in this part of hits count
$digit = substr($hits_count, $i, 1);
echo " ";
}
// output hits count image
?> |