Hawkee is right, and second to that, if the site has high amounts of traffic the fopen will get errors because it will be locked by the same script running for another user. Use MySQL instead. Also why are you using the $HTTP_* variables? They are deprecated and have been replaced with the $_SERVER array.