简体   繁体   English

PHP a href未链接

[英]PHP a href not linking

I've been working on managing this site for a little bit and out of nowhere today I've lost functionality of links (of the type). 我一直在管理这个站点,但是今天我无处不在失去了链接(这种类型)的功能。

I've looked high and low, and I'm pretty sure the syntax is right on this link (it's never given me a problem before), but for some reason it won't link now! 我一直都处于高低状态,而且我很确定该链接上的语法正确(以前从未给我一个问题),但是由于某种原因,它现在不会链接! I want to pass the 'SomeString' element from my $array[] to myPage.php. 我想将'SomeString'元素从我的$ array []传递到myPage.php。 Hovering over the link displays the right url, but clicking doesn't do anything. 将鼠标悬停在链接上会显示正确的网址,但单击不会执行任何操作。 Nor can I right-click on the element in a browser to "Inspect Element", go figure! 我也不能在浏览器中的元素上单击鼠标右键以“检查元素”,图!

echo "<li><a href='myPage.php?q=" . $array[$j]['SomeString'] . "'>" . $array[$j]['Name'] . "</a></li>";

Any suggestions would be greatly appreciated. 任何建议将不胜感激。

View source and see what it's outputting. 查看源代码并查看其输出。 I'd bet your SomeString has a quotation mark in it - you should be running it through urlencode , most likely. 我敢打赌,您的SomeString中带有引号-您很可能应该通过urlencode运行它。

检查$array[$j]['SomeString']以查看它是否返回与以前相同的值。

var_dump($array[$j]['SomeString']);

我遇到了同样的问题,清空了缓存,问题消失了,并且href超链接到了我想要的页面。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM