Sehr vereinfacht können wir sagen, dass jede Anziehungskraft der Chemie auf die Anziehung zwischen
positiver und negativer Ladung beruht.
Kurz: Plus + Minus ziehen sich an; gleiche Ladungen stoßen sich ab.
$filename!");
}
else
# There was no previous count file, so we'll just start from scratch.
updateCounter($oldcount);
# This function takes an integer as argument and increases it if certain
# requirements are met. Finally it writes the new number to a text file,
# then prints the number as well as a text label.
function updateCounter($oldcount)
{
# Make sure we have our variables handy.
global $useSession, $filename, $labelSingular, $labelPlural;
# If sessions have been disabled, or if they have been enabled and the user
# has not yet been counted...
if (!$useSession || ($useSession && !$_SESSION['userHasBeenCounted']))
{
# Open the file for writing.
if ($file = @fopen($filename, "w"))
{
# Increase old count by one.
$oldcount++;
# Write the count to the open file.
fwrite($file, $oldcount);
# Close the file again.
fclose($file);
# If sessions are in use, set an index to 'true' to avoid this session
# getting counted more than once.
if ($useSession)
$_SESSION['userHasBeenCounted'] = true;
}
else
# We don't have write access to the file.
die("Kein Schreibzugriff auf $filename!");
}
# Print the current count.
print $oldcount;
# Print a text label, according to the current count.
print ($oldcount==1) ? $labelSingular : $labelPlural;
}
?>