Twinkie
Banned
- Messages
- 1,389
- Reaction score
- 12
- Points
- 0
Needless to say, I have not scripted in PHP for 3 months now and I have found my self to forget the most basic concepts. Could some one please remind me why this is not working?
I was planning to put a simple IP counter for all IP addresses but my own, like a visit counter. Basically, it checks if I am the person on the web site, otherwise it assigns the value "Foriegn!" to the $Info variable which is printed some ways down the page. Even though I have proven that the IF statement evaluates correctly, for some reason, the function is unable to change the value of the variable and output is the default value: "None". Why is that, especially since it can print the default value?
_____________
Output: "None"
Also, does anybody know why in certain pages, like some of the JavaScript games I have been working on, the IDs and getElementById() does not work? Is it due to improperly nested DIV, TABLES, FIELDSETS, ect?
PHP:
<?php
$Info = "None";
function LoadResults() {
$Info = "It is Me!";
return true;
}
function LogIpCount() {
$Info = "Foriegn!";
return false;
}
if ($_SERVER['REMOTE_ADDR']=="000.000.000.000") {LoadResults(); echo "1";}
else {echo "2"; LogIpCount();}
?>
<html>
meaningless code...
<body><?php echo $Info; ?></body>
</html>
_____________
Output: "None"
Also, does anybody know why in certain pages, like some of the JavaScript games I have been working on, the IDs and getElementById() does not work? Is it due to improperly nested DIV, TABLES, FIELDSETS, ect?
Last edited: