PHP新手。继续
解析错误:语法错误,意外T_ECHO
用我的代码。
<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token=' echo $client['id']);
?>
无法弄清楚语法错误是什么。感谢。
答案 0 :(得分:2)
在你的行的最后,你有:
echo $client['id']);
您尝试将$client['id']
附加到网址,因此请移除echo
并将其替换为.
:
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token=' . $client['id']);
答案 1 :(得分:1)
您必须连接值:
<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token=' . $client['id']);
答案 2 :(得分:0)
试试这个
<?php
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);
?>
答案 3 :(得分:0)
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);
答案 4 :(得分:0)
如果要连接字符串,则不使用echo
,而是使用.
(点)。因此,请将header
行更改为:
header('Location: http://www.dcaccountancyservices.com/index.php?option=com_chronoforms&tmpl=component&chronoform=EditClient&token='.$client['id']);