How to pass the value of input in variable?

You want to calculate the discount
There is the initial price and the discount input field
<form action='v.php?ix=lbgDB52SK23&p0=$p0&iD=$id_pac' method='post'>
<a>the Price is: $Z</a>
Discount <input name='s' size='3'></input>%
the result : $Z2

$Z1= $Z want to multiply by input and divide by 100
Well, then withdraw

and I'm interested in the simple question, how to get the value entered in the form <input name='s'
March 19th 20 at 08:36
1 answer
March 19th 20 at 08:38
After you submit the form the value entered in a input will be available in the variable $_POST['s']
after sending the form POST method... - mollie_Nitzsche commented on March 19th 20 at 08:41
I need to send.
Enter to input a percentage and it immediately calculates in $Z2 well, and then the final amount to be transferred is sent.
I understand that I need to get this input and starting point of $Z taken out of the form?And the form itself have to pass $Z2? - Rylee.Brekk commented on March 19th 20 at 08:44
@Rylee.BrekkDirectly in the browser dynamically you nothing will count in PHP, it is not for this. JS needs to read the value in the browser, and then submit the form - martine_Streich90 commented on March 19th 20 at 08:47
@Rylee.Brekkyou can read directly on the client, without sending anything anywhere, using JS. If this is not allowed, then send the value of input using JS on the server (AJAX to help). But already there is a count in PHP - rosina_Parker commented on March 19th 20 at 08:50
@rosina_Parker, during the overworked, clap that I can't do this without js directly in the client count. - Rylee.Brekk commented on March 19th 20 at 08:53

Find more questions by tags PHP