I’m having multiple images (all which are clickable and have a value associated with each) on a page. Now I want to click any of the images (representing images) and that value is stored in array. So lets say I choose image of drink then meal then extras so everytime I choose one, it is updated in array as element. I am planning to do this in PHP so i was thinking something like PHP self submit? any illustrations are helpful…
Each time I add an item, I need a counter on the same page to increase/increment…
Thanks in advance and appreciated
You cannot do that only with PHP, as PHP is only executed before the page is shown.. You need to use Javascript and maybe AJAX to update your data on your back end.
Your best option is to add those highlighted items in Javascript and then send it via AJAX to your php handler.