Note that there are some explanatory texts on larger screens.

plurals
  1. POseparate one link into multi-links (php)
    text
    copied!<p>I have result php page with a html table. Inside <code>row[3]</code> i have <em>spoilers</em>. if i click on a text value i can see hidden content.<br> Inside hidden content i have <em>links</em> on different lines<br>To make this:<br> - I insert text inside mysql textarea, so:<br><br> <img src="https://i.stack.imgur.com/Skf0x.png" alt="enter image description here"><br> - Then I add javascript code in <code>&lt;head&gt;</code>section<br></p> <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $(".spoiler-label").click(function() { $(this).parent().find(".spoiler-content").toggle(); }); }); &lt;/script&gt; </code></pre> <p>- and then php code:<br></p> <pre><code>echo '&lt;td&gt;&lt;span class="spoiler-label"&gt;'.$row[1].'&lt;/span&gt;&lt;div class="spoiler-content" style="display: none"&gt;&lt;br&gt;&lt;a href='.$row[3].'&lt;a/&gt;&lt;/div&gt;&lt;td&gt;'; </code></pre> <p>- To break the text in new lines i use this php code:<br></p> <pre><code> $row['3']=stripslashes($row['3']); $row['3']=str_replace('&lt;br /&gt;',"newline",$row['3']); $row['3']=htmlentities($row['3']); $row['3']=str_replace('newline',"&lt;br&gt;",$row['3']) </code></pre> <p>i obtain this final result:<br><br> <img src="https://i.stack.imgur.com/cwkRc.png" alt="enter image description here"></p> <p>but you can see the problems:<br><br> - formatting is missing because the <code>&lt;th&gt;</code> of row X is black and not orange<br> - the links inside the spoiler are 2 but are treated as if they are one link. <br> - i have not correctly link because <strong>google.com</strong> is <code>http://google.com&lt;br</code> WHY?<br> You can see 2 links:<br> <code>http://alfa.com</code> <br> <code>http://google.com</code><br> but if i click over <a href="http://alfa.com" rel="nofollow noreferrer">http://alfa.com</a> the link is always <code>http://google.com&lt;br</code><br> <strong>I want</strong>:<br> -remove <code>&lt;br</code> from link<br> -separate one link into different links (alfa.com &amp; google.com) <br> -repair incorrect row formatting<br><br> This is my page complete code <a href="http://pastebin.com/zb22VqwD" rel="nofollow noreferrer">http://pastebin.com/zb22VqwD</a> and this css <a href="http://pastebin.com/dFRFURGM" rel="nofollow noreferrer">http://pastebin.com/dFRFURGM</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload