hi! I was unable to find any pre-written php code for a survey without a
database and using text files. So I was faced with the challenge of writing
my first script! -lol

What I eventually ended up with was a 3 answer poll, that will be called for
as many questions as I need, then I wil display the total results at the end
of the survey.

The problem is that the only way I was able to get it to work was to create
a seperate text file for each available answer, (eg, yes.txt, no.txt
notsure.txt) Which fir multiple questions can get kinda filey-lol

This is what I WANTED to do, but was unable so far to find the way if there
is one.

I wanted to have one text file for answer storage, possibly writing the
values for each answer on a seperate line, or a comma seperated list on one

I was never able to extract values from a specific area in the text file. I
tried to use fseek() to move the file pointer, but all I could get was 1 or
0. As I write this I thtink I remember reading of a function that allows you
to read part of a file, and print the rest or something, but I need to able
to first read a specific line, or value in the file, then extract just that
value, and then update that value acording to the users answer, and then
replace the updated value back in its respective place. All without touching
the other values.

Can anyone guide me to the proper way of figuring this out?

Also, I wanted to create a IP log to prevent anyone from taking the poll /
survey. The way I did it was to simply write the users "REMOTE_ADDR" to a
text file, and then I used strstr($firstvalue, $second) to search for it and
display the appropriate content.

Is this appropriate>?

thanks for reading this far-lol

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to