尝试使用curl获取信息但出现http错误

时间:2018-12-02 11:04:35

标签: php xml curl parameters method-call

所以我在下面有这段代码。但是,每次我尝试执行它时,都会收到一个is currently unable to handle this request. HTTP ERROR 500错误。我不确定为什么。

<?php
    $newname=1;
    $cid=(curl -s -q "http://secure.imvu.com/catalog/skudb/gateway.php" -X POST -d "<?xml version="1.0"?>
<methodCall>
<methodName>gateway.getUserIdForAvatarName</methodName>
<params>
<param><value><string>$newname</string></value></param>
</params></methodCall>" | tr "<int>" "\n" | grep -i [0-9] | tail -1);
    echo $cid;
?>

错误:

[02-Dec-2018 12:53:39 UTC] PHP Parse error:  syntax error, unexpected '"http://secure.imvu.com/catalo' (T_CONSTANT_ENCAPSED_STRING) in test.php on line 3

0 个答案:

没有答案