【发布时间】:2010-11-24 18:04:13
【问题描述】:
我正在运行代理,因此我可以通过 url 参数对数据执行 ajax 请求。代理 php 看起来像:
<?php
header('Content-type: application/xml');
$daurl = 'http://thesite.com/form.asp';
$handle = fopen($daurl, "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>
我正在使用 ajax 访问代理,最终附加了如下参数:
$j.ajax({
type: 'GET',
url: 'sandbox/proxy.php',
data: 'order=' + ordervalue,
dataType: 'html',
success: function(response) {
$j("#result").html(response);
}
});
所以请求就像是 sandbox/proxy.php?order=123
如何获取该数据 (order=123) 并将其附加到 $daurl 变量 (http://thesite.com/form.asp?order=123) 以便让代理实际返回一些内容?
这对我来说是处女地,所以你不能过度解释=)
【问题讨论】: