If you have an html and you sumbit it to a basic PHP file receiver, I wonder how you make them add up. how do you make the submitted forms stack instead of each submission replacing the other? I have no clue where to even start looking for an answer.
wrap print statements and make wrap element an array?
do i need file I/O for this so the messages get stored somewhere?
PHP is a very confusing jungle for me at the moment. Note that I haven’t gotten to the database part of php in my course yet.
many thanks in advance
Of course you will need file I/O to store messages.
Otherwise how they are supposed to be saved?
So, you have to save your messages in a file.
To add new data at the bottom of the file you have to append it instead of rewriting.
if you’re using
file_put_contentsfunction, use it with FILE_APPEND flag:if you’re using
fopen(), use'a'mode instead of'w'