As an alternative fix, you could avoid using wget
— which, as its name implies, is intended for getting web content from a given URL. In other words, it's built to be a "download" tool. (It is, of course, very flexible, as Indrek demonstrated in his answer. But its defaults work against your purposes.)
Since you don't need or want to actually download anything (you're just accessing the URL to fire off a server-side script), the curl
command is a bit more appropriate for your script. It will write the results of its requests to stdout by default, instead of to a file.
So, replacing wget
with curl
in your code above should fix the file-creation problem without any further work.