I'm saying that using require doesn't allow you to execute any PHP code at all. Any PHP code you have in that script is going to be executed on the remote server and the only thing sent back to the server with that require() statement is the output (if any).
So any database calls or functions dealing with the file system, for example, would be made on the remote server. In other words, you shouldn't even bother using require() just use readfile() or something that takes whatever is sent and outputs it to the user.