Can I put PHP code somewhere in the back-end?

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 can do this with ajax too, for example with the get method you can send through your datas. Then in your php file you can ask those datas down.

jQuery.get( "" , { name: "John", time: "2pm" });
$name = $_GET['name']; 
$time = $_GET['time'];