You're incorrectly concatenating strings, as @hobbs suggests. You're also using the undefined variable $Tournament
, which I think should be $name
. Try this:
$secret = '{"name":"' . $name . '","extra":"' . $extra . '","password":"' . $password . '","report":"' . $reception . '"}';
On a side note, a slightly nicer way to create JSON in PHP is to use an array and json_encode()
:
$secret = json_encode(array(
'name' => $name,
'extra' => $extra,
'password' => $password,
'report' => $reception));