Jump to content

h0mayun

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

h0mayun's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi guys im trying to create a php mysql hit counter,it will counts hits on every page here is the code <?php function log_hit(){ $page = mysql_real_escape_string(basename($_SERVER[ 'SCRIPT_NAME' ])); //echo $page; $sql = "INSERT INTO `hits` ( `page_name`, `hits` ) VALUE ( '{$page}', 1) ON DUPLICATE KEY UPDATE `hits` = `hits` +1"; mysql_query($sql); } function fetch_stats(){ $result = mysql_query( 'SELECT `page_name`, `hits` FROM `hits` ' ); $stats = array(); while (($row = mysql_fetch_assoc($result)) !== false){ $stats[ ] = $row; } return $stats; } ?> so by adding log_hit(); function in pages it will record hits but im trying to restrict my ip address to be counted i mean i dont want to that mysql record hits from certain IP address,in this case my ip address so i added this codes $ip = getenv("REMOTE_ADDR") ; $myip = "127.0.0.1"; if ( $ip != $myip ){ //above code } it works good but when i open a page gives me an errorr Call to undefined function log_hit() and nothing loads how to ignore this error anf just force to loading page?
  2. i figured it by my self but i should have some courses to pass you security questions that's why there is no willing to post and i dont like it too.
  3. thx for reply im trying to get information from a whois and i need only one line of information which shows a date when domian has bee created something lik that: Registered on: before Aug-2006 so i need to capture information afrer "Registered on: "
  4. hi guys i want to get everything after certain word with preg_match function "everything" is usually in format like this: word Word-000 which regular expressions should i use? thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.