模板标签里面
代码放到自定义页面的模板里运行报错,是哪里写错了吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?php
$urls = array(
{module module=dir}
'{$t['url']}',// 这里填写你的域名
{/module}
);
$api = 'http://data.zz.baidu.com/urls?site=https://www.xiaobaiben.com&token=eOrbUJcy88MRvH1l';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
?>
</body>
</html>
<?php $urls = array( ); ?> {module module=dir} {php $urls[]=$t['url'];} {/module}<?php $api = 'http://data.zz.baidu.com/urls?site=https://www.xiaobaiben.com&token=eOrbUJcy88MRvH1l'; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo $result; ?>