troubleshooting Question

writing the HTML form posted fields into a text file with tab spaces

Avatar of ARAVINDBABU
ARAVINDBABU asked on
PHP
4 Comments1 Solution151 ViewsLast Modified:
Hi,

I have 2 questions and i think i have gave enough points. both are related to file handling in php.

first:

I have some HTML forms with different fields
example:

form1                             form2                          form3                       and so on upto 6 forms

firstname                      username                       firstname
username                      sex                                your city
lastname                       email                             your country
age

i have a text file like userdetails.txt. The file contains all the fields seperated by tab spaces.

example:

username  firstname  lastname  sex email  age  city  country and so on.

so when the user submits the form i need to enter all the fields of forms into the text file.It is not mandatory that user should enter all the fields. If he leaves some fields empty then in the text file the values corresponding column will be null.

second:

There is a text file will some numbers in it.
example
file.txt
2
3
4
5
and so on.
i want to read the last number from the file . i take some number as user input from a form and i want to add that many numbers starting from the last number taken from file.
example:
user input: 4
read last entry from file:5
append to file 6  7  8  9. these numbers must be appended in each line into the text file

I also have an idea of implementing the above but has some problems. If the first case does not work then i am thinking of database table,which is easy to implement. Second case i am able to get the numbers to put into file. But i dont get an idea to keep the numbers in seperate lines.

Thanks
babu.
Thanks


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros