Retrieve a value that comes from a jquey rquisition for PHP [duplicate]

2

I'm here with a difficulty, I'm getting a value that comes from a JQUERY request to be presented in an input form, with the code:

HTML

<input type="text" id="valor">

With this TAG I can retrieve the value I want in HTML, my problem now is how I'm going to pass it to a PHP variable.

I already tried to use this method, it follows the code:

JAVASCRIPT

var valor = document.getElementById("valor").value;

Next in PHP I try to retrieve it this way, follow the code:

PHP

$varphp = "<script>document.write(valor)</script>";

But I could not, what can I do to fix the code? I need the code that appears in the TAG input of the form to be converted to a PHP variable.

    
asked by anonymous 02.08.2015 / 02:03

1 answer

0

This interaction does not exist (or should not exist).

In this context js is running in the browser and PHP is on the server.

The input value should be passed to a PHP page via request.

    
02.08.2015 / 02:11