I'm building a site with php, javascript and a mysql database. This page consists out of a titleFrame (with a counter), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
p.s. sorry for my bad englisho). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
p.s. sorry for my bad englishblue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $rowї"e;visitorBrowser"e;];
$visitor->visitorOS = $rowї"e;visitorOS"e;];
$visitor->visitorOSLanguage = $rowї"e;visitorOSLanguage"e;];
$visitor->userID = 0;
}
Then I want to save the session:
Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
p.s. sorry for my bad englisha mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. Wheisitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't i'm building a site with php, javascript and a mysql database. This page consists out of a titleFrame (with a counter), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldre for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
[color=green:68), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database asloginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannotse to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
p.s. sorry for my bad englishks like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime&eFrame (with a counter), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table [color=blue]if (!IsSet($_SESSION["visitor"]))[/color]. It works like this:Code: Select all
mysql_query("e;INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strangea mysql database. This page consists out of a titleFrame (with a counter), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the str. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening :- this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a ote;REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());
Then I do the following to get the current visitorID (or number or what you want to call it):
Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"base (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new sta and a mysql database. This page consists out of a titleFrame (with a counter), a loginFrame, a menuFrame and a mainFrame. Only the titleFrame and mainFrame are important here for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I search everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists)for this to work.
Now everytime someone visits my homepage this persons stats will be saved into the database (or that's what I want my page to do). What I do is the following: I connect to my database to add visitor stats to a certain table if (!IsSet($_SESSION["visitor"])). It works like this:
Code: Select all
mysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to thi. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());
Then I do the following to get the current visitorID (or number or what you want to call it):
Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they shoumysql_query("INSERT INTO visitor (visitorIP, blahblah) VALUES ('". $_SERVER["REMOTE_ADDR"]. "', 'blahblah')") or die(mysql_errno(). ": ". mysql_error());
Then I do the following to get the current visitorID (or number or what you want to call it):
Code: Select all
$dbsQuery = "SELECT * FROM visitor ORDER BY visitorID DESC LIMIT 1";
$result = mysql_query($dbsQuery) or die (mysql_error());Code: Select all
if (!$row = mysql_fetch_array($result)) {
blahblah;
} else {
$visitor = new visitorClass; //OFCOURSE DEFINED AT THE START OF MY PAGE
[color=blue]$visitor->visitorID = $row["visitorID"];
$visitor->visitorIP = $row["visitorIP"];
$visitor->visitorVisitDate = $row["visitorVisitDate"];
$visitor->visitorVisitTime = $row["visitorVisitTime"];
$visitor->visitorBrowser = $row["visitorBrowser"];
$visitor->visitorOS = $row["visitorOS"];
$visitor->visitorOSLanguage = $row["visitorOSLanguage"];
$visitor->userID = 0;
}Code: Select all
$_SESSION["visitor"] = $visitor;Now the strange thing is that when I visit my page for the first time the stats are entered into my database as they should be added (checked with MySQL Query Browser). But when I want to display those stats into my mainFrame (thus asking for $_SESSION["visitor"]) it doesn't display anything. When I hit F5 however the visitorID increases with 1, new stats are saved to the database and then $_SESSION["visitorID"] suddenly DOES exist also for the mainFrame. When I hit F5 again visitorID doesn't increase (and it shouldn't increase if the session already exists).
Is there any way to solve this? I searched the internet and I cannot find anything related to this topic. If there's a better way to do it I'm also listening
p.s. sorry for my bad english