Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 06-27-2009, 05:31 PM   #1
DomainProfitsClub.com
War Room Member
 
Gene Pimentel's Avatar
 
Join Date: Feb 2007
Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1
Thanks: 946
Thanked 1,639 Times in 652 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Write FORM data to text file?

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

Gene Pimentel is offline   Reply With Quote
Old 06-27-2009, 05:47 PM   #2
Senior Warrior Member
War Room Member
 
mywebwork's Avatar
 
Join Date: Sep 2008
Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1
Thanks: 759
Thanked 724 Times in 505 Posts
Default Re: Write FORM data to text file?

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
mywebwork is offline   Reply With Quote
Old 06-28-2009, 06:53 AM   #3
DomainProfitsClub.com
War Room Member
 
Gene Pimentel's Avatar
 
Join Date: Feb 2007
Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1
Thanks: 946
Thanked 1,639 Times in 652 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: Write FORM data to text file?

Thank you Bill, I'll check that out.

Gene Pimentel is offline   Reply With Quote
Old 06-28-2009, 07:29 AM   #4
HyperActive Warrior
War Room Member
 
john_kennedy's Avatar
 
Join Date: Dec 2002
Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
Social Networking View Member's FaceBook Profile 
Contact Info
Send a message via Skype™ to john_kennedy
Default Re: Write FORM data to text file?

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
john_kennedy is offline   Reply With Quote
Old 06-28-2009, 08:19 AM   #5
DomainProfitsClub.com
War Room Member
 
Gene Pimentel's Avatar
 
Join Date: Feb 2007
Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1
Thanks: 946
Thanked 1,639 Times in 652 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: Write FORM data to text file?

Quote:
Originally Posted by john_kennedy View Post
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
Hi John,

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.

Gene Pimentel is offline   Reply With Quote
Old 06-28-2009, 08:56 AM   #6
HyperActive Warrior
War Room Member
 
john_kennedy's Avatar
 
Join Date: Dec 2002
Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
Social Networking View Member's FaceBook Profile 
Contact Info
Send a message via Skype™ to john_kennedy
Default Re: Write FORM data to text file?

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
john_kennedy is offline   Reply With Quote
Old 06-28-2009, 12:40 PM   #7
DomainProfitsClub.com
War Room Member
 
Gene Pimentel's Avatar
 
Join Date: Feb 2007
Location: Oswego, NY USA
Posts: 2,990
Blog Entries: 1
Thanks: 946
Thanked 1,639 Times in 652 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: Write FORM data to text file?

Thank you John! I'll play around with that.

Gene Pimentel is offline   Reply With Quote
Old 06-28-2009, 12:52 PM   #8
HyperActive Warrior
War Room Member
 
john_kennedy's Avatar
 
Join Date: Dec 2002
Location: Mobile, AL , USA.
Posts: 302
Thanks: 75
Thanked 49 Times in 44 Posts
Social Networking View Member's FaceBook Profile 
Contact Info
Send a message via Skype™ to john_kennedy
Default Re: Write FORM data to text file?

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
john_kennedy is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
data, file, form, text, write

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 09:22 PM.