-5

PHP新手。继续获取

解析错误:语法错误,意外的 T_ECHO

用我的代码。

<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='  echo $client['id']);
?>

无法弄清楚语法错误是什么。谢谢。

4

5 回答 5

2

在你的行的最后,你有:

echo $client['id']);

您正在尝试将 附加$client['id']到 URL,因此删除并将其echo替换为.

header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token=' . $client['id']);
于 2012-10-22T12:42:18.587 回答
1

您必须连接这些值:

<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='  . $client['id']);
于 2012-10-22T12:42:11.667 回答
0

try this

<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);
?>
于 2012-10-22T12:42:21.020 回答
0
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);
于 2012-10-22T12:42:30.303 回答
0

You do not use echo when you want to concatenate a string, you use . (dot). So change the your header line to:

header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);
于 2012-10-22T12:43:18.030 回答