![]() | | ||||||||
| | #1 |
| DomainProfitsClub.com War Room Member Join Date: Feb 2007 Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1 Thanks: 946
Thanked 1,639 Times in 652 Posts
|
I'd like to create a form with 3 fields, which will take the contents of each of the 3 fields and store them in a text file. ============================================== Form ============================================== Enter Website URL Here: [_________________] Enter Account ID# Here: [_________________] Enter Email Address Here: [_________________] [ SUBMIT ] ============================================== When the user submits that form, the information gets written to a text file containing only this: ============================================== Text file named info.inc ============================================== <?php $weburl = "WebSiteName.com"; $accountid = "12345"; $email = "usersemail@anymailaddress.com"; ?> ============================================== Any time the user goes back to the form above and changes the data in any of the 3 fields, the text file will be overwritten accordingly. Note: The text file will have the CHMOD permission set to 644 so nobody else can write to it. Note: The form will be in a password protected folder. No help needed to create the form and password protected folder. I just need to know how to get the form SUBMIT to overwrite the text file to contain the new form data. Thanks! Gene |
| | |
| | |
| | #2 |
| Senior Warrior Member War Room Member Join Date: Sep 2008 Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1 Thanks: 759
Thanked 724 Times in 505 Posts
|
Hi Gene I think what you'll need to do is submit the form to another PHP file, extract the form field values from the GET (or POST) data and then use PHP to write the file. Here are some links that may be of some help with writing to files: Write File - PHP Write File - PHP Write to File PHP Tutorial - File Write Hope this helps Bill |
| | |
| | #4 |
| HyperActive Warrior War Room Member Join Date: Dec 2002 Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
|
What happens if I return and change all 3 fields? How will the program know how to find my earlier entry into the field? Normally there would be a constant that they could not change like your field for the accountid. That way, the program has something to search on and based on the results either update the information or add a new record. John |
| | |
| | #5 | |
| DomainProfitsClub.com War Room Member Join Date: Feb 2007 Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1 Thanks: 946
Thanked 1,639 Times in 652 Posts
| Quote:
Each time the form is used, I want the whole text file to be overwritten with the new info. There is no need for the program to know what the current info is. | |
| | ||
| | |
| | #6 |
| HyperActive Warrior War Room Member Join Date: Dec 2002 Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
|
Well, I tried to post some code for you but couldn't get it to post. Try this: www . hotscripts . com/forums/script-requests/6580-php-write-text-file.html I can't post links yet so take out the spaces around the dots. John |
| | |
| | #8 |
| HyperActive Warrior War Room Member Join Date: Dec 2002 Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
|
Let me know how it goes. Even though I have been registered here for eons, I rarely post and can't PM yet, but you can reach me at mrprez @ gmail . com if you get stuck getting this going. John |
| | |
![]() |
|
| Tags |
| data, file, form, text, write |
| Thread Tools | |
| |
![]() |