Can I put PHP code somewhere in the backend?

No you can’t. You should just create a PHP file, redirect there, and make your file to redirect back, or if you know more advanced programming, you could do this with Ajax too, for example with the get method you could send through your datas:

jQuery.get("http://example.com/test.php",{ name:"John", time:"2pm"});

And in your php file you can ask those data down like this:

$name = $_GET['name'];
$time = $_GET['time'];