Can you post the relevant portion of the template you are putting the php code in?
As long as your path to the text file is correct and you wrap the php code in {php}{/php} tags in your template, it should work (as my limited understanding allows me to say

)
Once you get that working though, looking into using native smarty language code would be ideal - there should be code to set an array and to pull a random line from it.
Cheers,
Regs.