我有一张桌子:
gold_2012
gold_city | gold_type | gold_cost | gold_selltime
--------------------------------------------------
city1 | type 1 | 41.23 | 2012-01-01
city1 | type 1 | 42.23 | 2012-02-02
city1 | type 1 | 40.23 | 2012-03-03
city2 | type 2 | 43.23 | 2012-01-01
city2 | type 2 | 45.23 | 2012-02-02
city2 | type 2 | 47.23 | 2012-03-03
city3 | type 3 | 48.23 | 2012-01-01
city3 | type 3 | 49.23 | 2012-02-02
city3 | type 3 | 44.23 …Run Code Online (Sandbox Code Playgroud) 如何通过javascript重定向该页面之后获取整页内容?
在executewebpage.php中:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setOpt($ch, CURLOPT_POST, TRUE);
$url = 'http://www.doredirect.com';
$postfields = array('doredirect'=>'true','trigger'=>'1');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
echo($data); //In this step, it redirect to page: http://www.finalpage.com
curl_close($ch);
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得http://www.finalpage.com的内容?
注意:如果我没有回显,它不会返回任何内容,也不会重定向到任何页面
非常感谢!
如何在PHP中将PHP时间转换为Javascript时间?我的PHP代码:
<?php
$times = array(/* A list of time with "Y-m-d h:i:s" format goes here */);
$return = '[';
$i = 1;
foreach($times as $time) {
$return .= '['.strtotime($time).','.$i.'],';
//In my opinion, converting time to
//js time at here is good choice
if($i==100) {
break;
}
$i++;
}
$return = substr($return, 0, -1).']';
?>
Run Code Online (Sandbox Code Playgroud)
我的剧本:
<script>
var results = [{
label: "Buy in",
data: <?=$return?>
}];
</script>
Run Code Online (Sandbox Code Playgroud)