I am trying to create quite simple project. I will explain it on an example.
Description on what i am trying to do using simply example:
Let say you can upload two images to my site, select size (1000×500 or 2000×1000), and write some text. My site would merge these 2 images into one, of course resizing it properly, and write some text on top of the images. That’s quite simple. After generating such image, it sends you to a page where you can preview the image and there is a Paypal button with 1$ price. Everything in $_POST[] when it comes to PHP and GD so it should be safe.
I want to allow user push “next image” saving the one he already made, and make another one. Same process, he finishes at a site with 2 image previews, and a button saying 2$. Again shouldn’t be that hard.
Problem and the question:
But here comes my question. User created 2 images, both 1000×500, and he see both previews. And i want to let him change ON THIS SCREEN one image to 2000×1000, but that also means change of the price. So is that possible without reloading the page, to change SAFELY quantity or some properties of images, also altering price on paypal button?
I am sure javascript isnt the best idea here. I saw paypal lets me use “Add drop-down menu with price/option” but i cant rly use it determine which photo gonna be big one, and which one small one. Cuz with 3 photos there are already quite some possibilities (all small, 1st big, second big, two big etc)…
Solution i wish not to use, but didn’t find any other so far:
Or i have to let him change these properties/values in a form (disabling buy button somehow), and then pass everything using $_POST[] which would redirect him to page, with proper button?
I know its kinda messy, but i tried to explain it best i was able too. My english isn’t the best. Hope you guys understand what i am trying to do.
it’s not
messyand many website does it, example:On many Buy-Pages, when you choose US as a
countrythe page submits itself to the server and a newstatedropdown appears.You can certainly do that, or use AJAX. But, if there are only a few options I WOULD use JS/jQuery to change the prices (especially since it’s such low prices and since the prices are static).