简体   繁体   English

解析错误:语法错误,意外的“ href”(T_STRING),期望为“,”或“;”

[英]Parse error: syntax error, unexpected 'href' (T_STRING), expecting ',' or ';'

Getting error in this code...please help... i have changed it also like.... 这段代码中出现错误...请帮助...我也已经更改了....

    echo "<td>" <a href="get_file.php?id={.$row['quote_id']. }">Download</a>"</td>";

or 要么

<td><a href='get_file.php?id={$row['id']}'>Download</a></td>

still getting the error. 仍然出现错误。

This should work for you: 这应该为您工作:

(You don't concat the strings correctly and you forgot quotes for the href tag) (您没有正确连接字符串,并且忘记了href标记的引号)

echo "<td><a href='get_file.php?id=" . $row['quote_id'] ."'>Download</a></td>";

Concatenation is your friend when outputting HTML. 在输出HTML时,串联是您的朋友。

echo '<td><a href="get_file.php?id={'.$row["quote_id"].'}">Download</a></td>';

I usually try to put the single quotes on the outside and the double quotes on the inside because it's easier for me to manage. 我通常尝试将单引号放在外面,将双引号放在里面,因为它更易于管理。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解析错误:语法错误,意外的&#39;]&#39;,预期为T_STRING或T_VARIABLE或T_NUM_STRING - Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING 错误:(!)分析错误:语法错误,意外的&#39;&#39;(T_ENCAPSED_AND_WHITESPACE),需要标识符(T_STRING) - Error : ( ! ) Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) 我找不到错误:“解析错误:语法错误,意外”'DB_HOST'(T_STRING),期待')' - I Cant find the error: "Parse error: syntax error, unexpected" 'DB_HOST' (T_STRING), expecting ')' 解析错误:语法错误,意外的“;”,需要标识符(T_STRING)或变量(T_VARIABLE) - Parse error: syntax error, unexpected ';', expecting identifier (T_STRING) or variable (T_VARIABLE) Laravel 解析错误:语法错误,意外的 T_CLASS,在 artisan 中期待 T_STRING - Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING in artisan Wordpress-解析错误:语法错误,意外的“函数”(T_FUNCTION),期望的标识符(T_STRING) - Wordpress - Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) Laravel解析错误:语法错误,意外T_CLASS,期待T_STRING - Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING PHP后期静态绑定—分析错误:语法错误,意外的T_STRING,预期的T_VARIABLE - PHP Late Static Binding — Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE 解析错误:语法错误,意外的&#39;(&#39;,期望T_STRING或T_VARIABLE或&#39;与PDO - Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or ' with PDO PHP解析错误:语法错误,意外的T_STRING,预期的T_FUNCTION - PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM