PHP to text file - two forms on one page?

Shawna C

New member
This is embarrassingly easy (probably) but... I've set up a PHP page with a text area that saves to a txt file. The text file is then included on a live page. Then I have another PHP page with a text area that saves to another txt file for inclusion on the same live page. All works fine, but how can I put both text fields on one php page instead so both txt files can be edited without having to open another page? Like I said, I'm sure it's easy, but all my attempts have failed. Thanks! (Oh, and pretend like you're explaining to a five year old. I'm not a newbie, but I find code really hard to grasp!)
 
I think what you want to do here is just have 2 separate forms on the same PHP page. Make sure the text areas have a different id attribute so you can differentiate them. Both forms can submit to the same page, just check the id in the POST to see which one you've got. Hope this helps.
 
Back
Top