gpt4 book ai didi

php - 在 PHP 中使用参数形成 URL 的问题

转载 作者:行者123 更新时间:2023-11-30 22:08:41 25 4
gpt4 key购买 nike

我已经在 php 和 FETCH 部分(如故事和 ID)中建立了数据库连接。URL 在没有“&”的情况下可以正常工作,但在 URL 中添加“&”时会失败。

这是我的 php 代码,在 URL 中添加了 '&id='

$fullurl = /cms/page.php . '?chapter=' . $row['story'] . '&id=' . $row['id'];

谁能告诉我正确的语法...

最佳答案

错误很明显

$fullurl = /cms/page.php . '?chapter=' . $row['story'] . '&id=' . $row['id'];

应进行更改,以便所有文本都在引文标记内..

$fullurl = '/cms/page.php?chapter=' . $row['story'] . '&id=' . $row['id'];

否则你会出错。

另外,请考虑在调试时使用 error_reporting(E_ALL);

关于php - 在 PHP 中使用参数形成 URL 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40829074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com