Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要一些简单PHP的帮助吗_Php_Html_Xml_Steam - Fatal编程技术网

需要一些简单PHP的帮助吗

需要一些简单PHP的帮助吗,php,html,xml,steam,Php,Html,Xml,Steam,大家好,我只是想问一下如何用PHP编写下面的代码 <input type="text" name="SteamID64"> 当该人员进入并单击按钮时,应将该值填入以下表格中 <?php $xml=simplexml_load_file("http://steamcommunity.com/profiles/<STEAMID64 HERE>?xml=1"); echo $xml->steamID . "<br>"; echo $xm

大家好,我只是想问一下如何用PHP编写下面的代码

<input type="text" name="SteamID64"> 

当该人员进入并单击按钮时,应将该值填入以下表格中

    <?php
$xml=simplexml_load_file("http://steamcommunity.com/profiles/<STEAMID64 HERE>?xml=1");

echo $xml->steamID . "<br>";
echo $xml->onlineState . "<br>";
echo $xml->privacyState . "<br>";
echo $xml->avatarFull . "<br>";
echo $xml->body;
?>
steamID。“
”; echo$xml->onlineState。“
”; echo$xml->privacyState。“
”; echo$xml->avatarFull。“
”; echo$xml->body; ?>
很抱歉,如果我做错了这个问题,我是新来的

用于获取id:

$format = "http://steamcommunity.com/profiles/%s?xml=1";
$url = sprintf($format, $_POST["SteamID64"]);
$xml=simplexml_load_file($url);
我假设您已经正确设置了表单,例如:

<form action="TheTarget.php" method="post">
    <input type="text" name="SteamID64" /> 
    <input type='submit' value='submit' />
</form>

if (isset($_POST['SteamID64'])) {
 $id  = $_POST['SteamID64'];
 $xml = simplexml_load_file("http://steamcommunity.com/profiles/{$id}?xml=1");
}