Whichever field would be best really. Not sure. I just want users to be able to submit number from a list of pre-defined ones and then i want to be able to get a total of all of those numbers.
Well, do some. dumps to check where it goes wrong, maybe the page doesnât. exist or you donât get the right data from your post, without knowing what exactly. you are posting etc., itâs a. bit hard and you have to figure it out.
Iâm having trouble with the updating and adding of days. It constantly returns different values and never just adds up the numbers added. https://arrivals.melodyjane.com/ - please try.
What is that line doing there? I think I wrote before that the children() method doesnât accept a parameter.
And this line:
if($data) $error = 'Something is invalid.';
doesnât seem to make sense, either⌠What do you want to achieve here? In your comment says you validate the data, but in fact you fill the error variable if $data is true, hmâŚ
Also, if you want to validate your data, you should do that before you use the data, not after. for example, check if days is numeric and in the range of allowed values, and check if the value for country is in the array of allowed countries. Anyone can easily modify the data that is sent to the. server.
And one more thing: If you want to get the average arrival time, it doesnât make sense to add the values up. You would have to calculate an averageâŚ
This actually creates a folder underneath the country as a new âentryâ on arrival time. It does actually work okayâŚ
I do need to look into how to validate data, Iâm a total novice to all this unfortunately.
And one more thing: If you want to get the average arrival time, it doesnât make sense to add the values up. You would have to calculate an averageâŚ
I was going to use the total count of days divided by how many entries are under the country. So a count of the folders under âAustraliaâ for example.
If you store the data in those subpages anyway, you might as well retrieve it from there instead of also updating the main page itself.
But it would be better to only update the page with the new information without creating all those subpages that just clatter the folder for nothing. For example, you use a new counter field for the number of submissions (I,e, increase by 1 for each new submission, and you add up the days in the days field. Then you can easily display your average in the template.