如何在PHP中将HTML表单与Guzzle连接? <?php require '../vendor/autoload.php' ; use GuzzleHttp\Client ; $client= new Client(); $respons

如何在PHP中将HTML表单与Guzzle连接? <?php require '../vendor/autoload.php' ; use GuzzleHttp\Client ; $client= new Client(); $respons,php,html,guzzle,guzzlehttp,Php,Html,Guzzle,Guzzlehttp,如何在PHP中将HTML表单与Guzzle连接? <?php require '../vendor/autoload.php' ; use GuzzleHttp\Client ; $client= new Client(); $response= $client->request( 'GET', 'localhost:3000/persons/document.getElementById("findPersonByMobile").v alue' ); $body= $r

如何在PHP中将HTML表单与Guzzle连接?

<?php 
require '../vendor/autoload.php' ;
use GuzzleHttp\Client ;


$client= new Client();
$response= $client->request(
'GET',
'localhost:3000/persons/document.getElementById("findPersonByMobile").v
alue'
);

$body= $response->getBody();
$string= $body->getContents();
$json= json_decode($string);

document.getElementById("editPersonName").value = $json->name;
document.getElementById("editPersonAge").value = $json->age;
document.getElementById("editPersonGender").value = $json->gender;
document.getElementById("editPersonMobile").value = $json->mobile;