将一个链接分离为多个链接(php)
我有一个带有html表的结果php页面。第[3]行内将一个链接分离为多个链接(php),php,mysql,Php,Mysql,我有一个带有html表的结果php页面。第[3]行内我有扰流板。如果单击文本值,我可以看到隐藏内容。在隐藏内容中,我在不同的行上有链接: -我在mysql文本区域内插入文本,所以: -然后我在部分添加javascript代码 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript">
我有扰流板。如果单击文本值,我可以看到隐藏内容。
在隐藏内容中,我在不同的行上有链接:
-我在mysql文本区域内插入文本,所以:
-然后我在
部分添加javascript代码
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$(".spoiler-label").click(function() {
$(this).parent().find(".spoiler-content").toggle();
});
});
</script>
$(函数(){
$(“.spoiler标签”)。单击(函数(){
$(this.parent().find(“.spoiler content”).toggle();
});
});
-然后是php代码:
echo '<td><span class="spoiler-label">'.$row[1].'</span><div class="spoiler-content" style="display: none"><br><a href='.$row[3].'<a/></div><td>';
$row['3']=stripslashes($row['3']);
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',"<br>",$row['3'])
echo'.$row[1]。
链接总是http://google.com您正在使用beolow代码:
$row['3']=stripslashes($row['3']);
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',"<br>",$row['3'])
$row['3']=stripslashes($row['3']);
$row['3']=str_replace(“
”,“换行符”,“$row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',“
”,$row['3']))
使用以下代码代替上述代码:
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',"<br>",$row['3'])
$row['3']=str_replace(“
”,“换行符”,“$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',“
”,$row['3']))
只需将第一行替换为第二行,将第二行替换为第一行..只需尝试..希望这有帮助..您正在使用以下代码:
$row['3']=stripslashes($row['3']);
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',"<br>",$row['3'])
$row['3']=stripslashes($row['3']);
$row['3']=str_replace(“
”,“换行符”,“$row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',“
”,$row['3']))
使用以下代码代替上述代码:
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',"<br>",$row['3'])
$row['3']=str_replace(“
”,“换行符”,“$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$row['3']=str_replace('newline',“
”,$row['3']))
只需将第一行替换为第二行,第二行替换为第一行..只需尝试…希望这有帮助..首先,您的1行php代码回显错误(您没有关闭
)。css因此无法工作
(我去掉了第一个回声)
其次,一个
标记内不能有另一个
标记,因此您应该从上面的代码中删除整个
,这意味着它应该是:
echo '<td><span class="spoiler-label">'.$row[1].'</span><div class="spoiler-content" style="display: none"><br>'.$row[3].'</div><td>';
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$ary=explode('newline',$row['3']);
$str="";
foreach($ary as $str2){
$str.="<a href=\"$str2\">$str2</a><br/>";
//$str.="$str2<br/>";
}
$row['3']=$str;
首先,您的1行php代码回显是错误的(您没有关闭
)。css因此无法工作
(我去掉了第一个回声)
其次,一个
标记内不能有另一个
标记,因此您应该从上面的代码中删除整个
,这意味着它应该是:
echo '<td><span class="spoiler-label">'.$row[1].'</span><div class="spoiler-content" style="display: none"><br>'.$row[3].'</div><td>';
$row['3']=str_replace('<br />',"newline",$row['3']);
$row['3']=stripslashes($row['3']);
$row['3']=htmlentities($row['3']);
$ary=explode('newline',$row['3']);
$str="";
foreach($ary as $str2){
$str.="<a href=\"$str2\">$str2</a><br/>";
//$str.="$str2<br/>";
}
$row['3']=$str;
嗯..如果我尝试替换第127行的C:\xampp\htdocs\test2\test\zzz\risultati0.php中的语法错误,意外的“echo”(T_echo)是正常的吗?嗯..如果我尝试替换第127行的C:\xampp\htdocs\test2\test\zzz\risultati0.php中的语法错误,意外的“echo”(T_echo)是正常的吗?请给我看一下我的代码好吗?我不理解代码是如何编写的,无论如何谢谢你的帮助现在链接是分开的,但我仍然有css问题,我有双链接?看这里这是我的代码更新了我做错了什么?我没有把
改成
可以吗?如果是这样,在什么意义上我要把它改成
?,你指的是代码的哪一部分?实际上你不小心把代码翻了一倍..再次看到我的更改。在顶部和底部mm..有些地方似乎有所改进,但下载栏上的双链接下载链接和css仍然存在一些问题,请查看您的更正,有什么问题吗?您能给我看一下我的代码吗?我不理解代码是如何编写的,无论如何谢谢你的帮助现在链接是分开的,但我仍然有css问题,我有双链接?看这里这是我的代码更新了我做错了什么?我没有把
改成
可以吗?如果是这样,在什么意义上我要把它改成
?,你指的是代码的哪一部分?实际上你不小心把代码翻了一倍..再次看到我的更改。在顶部和底部mm..有些地方似乎有所改进,但下载栏上的双链接下载链接和css仍然存在一些问题,请查看您的更正,有什么问题吗?-1为长时间的非抽象本地化问题+1为努力把一个完整的职位与注释的图形-1.长非抽象局部问题+1为努力把一个完整的职位与注释的图形!