T
T
Theory Theory2021-04-24 12:07:48
JavaScript
Theory Theory, 2021-04-24 12:07:48

How to pass a variable to $_POST?

$custom_checkout_fields = [
  'order_comment',
  'delivery_method' 
];

foreach ($custom_checkout_fields as $field) {
    if ( ! empty( $_POST[$field] ) ) {
                 echo "wow";
    }
  }

echo does not work, although I fill out 'order_comment' and 'delivery_method' through the form, maybe it's impossible to pass a variable to $_post ??

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Egorov, 2018-08-19
@1Sergey1

How to implement a slider?

S
SKEPTIC, 2021-04-24
@pro100chel

$_POST contains what is passed in the parameters of the POST request. To do this, the form must have a POST submission type.
And if you manually write parameters in the url as in a GET request, then this is GG.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question