连接问题.确认消息不起作用

concatenation issues. The confirm message doesnt work

本文关键字:不起作用 消息 确认 问题 连接      更新时间:2023-09-26
    $html .= '<a href =delete.php?pid='.$data['pid'].' onclick="return confirm('Are you sure you want to delete?');">Delete Item |';

我们在连接上有一个问题。onclick不起作用。解析错误:语法错误,意外的'Are' (T_STRING) -出现此消息。

试试这个:

$html .= '<a href =delete.php?pid='.$data['pid'].' onclick="return confirm(''Are you sure you want to delete?'');">Delete Item |';

您需要转义确认消息周围的单引号