Skip to content
Advertisement

How can i automatically save the image inside a website when i click the add to cart?

how can I automatically save this pizza image, and save it to my local folder? I can easily save the other information, but I’m encountering automatically saving the image itself in a local folder?

I’m fetching the other data from different table, but the I can’t save the image itself. I’m have no intention of using foreign key for no.

backend.php

JavaScript

index.php

JavaScript

sample image

Advertisement

Answer

you can copy the image file from ‘../uploads/’ to ‘../images/’ and then you save it . you can do this with copy function

copy documentations

copy() example :

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement