Code: Select all
<?php
$con = mysql_connect("~","~","~");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
elseif ($_SERVER['REMOTE_ADDR'] == "~")
{
echo "aa";
}
else {
mysql_select_db("~", $con);
mysql_query("INSERT INTO bulletins (ip, dateline) VALUES('Four-". $_SERVER['REMOTE_ADDR'] ."', ". time() .")") or die(mysql_error()); } ?>
What this script is:
It's a script that upon loading, or viewing a page where it is embedded in the <img> tag, it records your IP address and unix timestamp into a database. There are different scripts to differentiate which page they are visiting..It's a shotty system but it's working for me right now.
Anyways, what I want to do is, if the IP address which loaded the page is mine, do nothing. Since there is no "do nothing" function i was just wondering if I could put
Code: Select all
echo "";Also, is there any way to put the date + time in instead of the unix timestamp?
Like.. the month and date, and the time in either military or standard, pst-8 or gmt?
something like.. date("l F jS Y");
Also is there a way to tell which page they were viewing that had that script on it?
like for example, if someone viewed http://www.blah.net/home and it contained the script track1.php, it would add it to the database like this:
"65.182.4.4","123485892","www.blah.net/home"
PS, the ~ are just things I didn't want shown.