So I'm working on an avatar system and I run into this problem. I'm using GD to generate the image, which is in it's own separate php file. In another file is where the image is called. I want it to where the user can use dropdowns to change the different layers on the image without having to reload the page every time. I mean the long way, like having the options saved in the database and the page is refreshed with a button click; showing the changes. If I did this it would write to the database every time the user tries something else, and I assume that's not good for performance. I just can't figure out a way to get the user's input from one file and have it affect the image generation file. Here's my setup if it helps:
- Image_generate.php: Separate images (used as layers) are merged into one image.
- Avatar.php: On the avatar creation page, the created image is displayed with html img src. A dropdown box saves the user's choice to the database when they hit 'submit'.
- That's it. The two can't talk to each other. Attempting database calls from image_generate.php gives a broken image; so even if I do save choices to the database, I can't seem to use it as a variable.