I create my HTML this way
$('<form>')
.attr('method',"POST")
.attr('action',"postMetier.php?metier="+"<?php echo $GET['metier'] ?>")
How can I make the echo work ?
I create my HTML this way
$('<form>')
.attr('method',"POST")
.attr('action',"postMetier.php?metier="+"<?php echo $GET['metier'] ?>")
How can I make the echo work ?
$GET
variable doesn't exists, correct name is $_GET
.
.attr('action',"postMetier.php?metier="+"<?php echo $_GET['metier'] ?>")
^
Of course, you JS code has to be in PHP file (or other which is parsed by server).
it is not $GET['metier']
but $_GET['metier']
, if there is value recieved on your page by get method then echo $GET['metier']
will give you some value.
Note: if $GET['metier']
is your defined variable, then it should have some value in it so that it can be echoed.