Skip to content
Advertisement

POST variable verification

I want to build a simple discount system. My idea is something like this: user will enter code & I want to verify it with PHP & update the price on the invoice (can do this part, that’s why i share just this part of code)

I would like to see your solution because as of now, this isn’t working at all, no response.

my actual code (HTML form):

JavaScript

PHP code:

JavaScript

Advertisement

Answer

This part of the code seems like it should not be placed in the test_input function, as that function returns the $data and this part is never called.

JavaScript

The following code should work as required (not tested):

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