I tried the code you posted...just copy and pasted basically to make sure i didn't make any mistakes and then i was getting the fatal error again...and then the next time i would get T_variable or T_string or something it was really weird....even when i tried to go back to before I started doing this something was wrong. I think my file got messed up some how. So what I did was start ALL over again...new document....typed everything out line by line...no copying or pasting....and just tested line by line incase I got an error i'd know exactly where it was ...but it worked...no errors and the whole purpose of this worked too. So I apologize something was wrong with my file I guess and this could have all worked from the very start. Sorry you had to do the whole thing...but I really appreciate it!