getting input, then outputting it

Hi!

I am a newbie to Unix. I was writing a little game program for fun when thought of an idea to allow data to be saved. I knew to take all of the Predefined variables and put them into a separate file, then including the file in the program. But I am having trouble making it so that the user can tell it to save the data and it would write the data to the page holding the Predefined variables. I am using PHP in my program.