PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// Dont forget the dash!
header("e;Content-type: application/ms-excel"e;);
header("e;Content-Disposition: attachment; filename="e;.$eventname."e;.xls"e;);
Note the missing - in ms-excel, and the correct filename extension.
Looking at your code, you're writing $out to the file, then sending the contents of that file. My guess is the contents of $out need to be adjusted if you're not getting what you want.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.