Points

Content count

Popular Content

I'm not aware of a REMOTE_REFERER key in the $_SERVER array. Perhaps you meant to use HTTP_REFERER. But even then, an undefined key would not throw a 500 error. I can't tell you why it's doing that from just the code you provided, you should check the server's error log.
If all you need is the referrer, though, Javascript already has that available without needing to send a request to the server. Use the document.referrer property.