我想用curl在PHP中創建一個用戶,請幫助。如何使用PHP在開放式火焰中添加用戶?
<?php
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?
<user>
<username>nitin</username>
<password>patel</password>
</user>";
$url = "http://111.111.111.111:5223/plugins/userService/users";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$contents = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
echo "\n<br />";
$contents = '';
}
else {
curl_close($ch);
}
if (!is_string($contents) || !strlen($contents)) {
echo "Failed to get contents.";
$contents = '';
}
echo $contents;
?>
它給輸出:P
對你不打算燒如果你用明火製造他,這個傢伙呢? – markus
輸出是什麼? – Jurik
嗨@Jurik我在輸出P時非常驚訝輸出 –