-6
我想從ajax獲得更多的值只有一個php文件。
我的代碼如下所示:
$.ajax({
type: "GET",
url: "phpfile.php",
success: function (value1,value2,value3,value4,value5,value6) {
$("#lga").html('<img src="' + value1 + '" alt="image" width="115" height="115"></src>');
$("#lg").text(value2);
$("#lgi").text(value3);
$("#lgv").text(value4);
$("#lgc").text(value5);
$("#lt").text(value6);
}
});
在PHP我有6 echo
:
<?php
$game = fetchinfo("value","info","name","current_game");
$lastwinner = fetchinfo("userid","games","id",$game-1);
$winneravatar = fetchinfo("avatar","users","steamid",$lastwinner);
$chance = fetchinfo("percent","games","id",$game-1);
$items = fetchinfo("itemsnum","games","id",$game-1);
$ticket = fetchinfo("winticket","games","id",$game-1);
$value = round(fetchinfo("cost","games","id",$game-1),2);
$winnername = fetchinfo("winner","games","id",$game-1);
echo $winneravatar;
echo $game-1;
echo $items;
echo $value;
echo $chance;
echo round($ticket*100,7);
echo $winnername;
?>
......然後?請提供更多關於您的實際PHP代碼和您想要的結果的信息。 – fusion3k
函數只能正確獲取第一個值。我試圖從一個PHP中獲取更多的值,而不是擁有6個PHP文件。 – Daniel
請顯示您的php代碼 – fusion3k