Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8757863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:24:15+00:00 2026-06-13T14:24:15+00:00

I have result php page with a html table. Inside row[3] i have spoilers

  • 0

I have result php page with a html table. Inside row[3] i have spoilers. if i click on a text value i can see hidden content.
Inside hidden content i have links on different lines
To make this:
– I insert text inside mysql textarea, so:

enter image description here
– Then I add javascript code in <head>section

<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>

– and then php code:

echo '<td><span class="spoiler-label">'.$row[1].'</span><div class="spoiler-content" style="display: none"><br><a href='.$row[3].'<a/></div><td>';

– To break the text in new lines i use this php code:

    $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'])

i obtain this final result:

enter image description here

but you can see the problems:

– formatting is missing because the <th> of row X is black and not orange
– the links inside the spoiler are 2 but are treated as if they are one link.
– i have not correctly link because google.com is http://google.com<br WHY?
You can see 2 links:
http://alfa.com
http://google.com
but if i click over http://alfa.com the link is always http://google.com<br
I want:
-remove <br from link
-separate one link into different links (alfa.com & google.com)
-repair incorrect row formatting

This is my page complete code http://pastebin.com/zb22VqwD and this css http://pastebin.com/dFRFURGM

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:24:17+00:00Added an answer on June 13, 2026 at 2:24 pm

    first off, your 1 line php code echo is wrong (u didnt close <a>). The css didnt work because of this.

    (i removed the first echo)

    second, an <a> tag cannot have another <a> tag inside it, so you should just remove the whole <a> from your code above, meaning it should be:

    echo '<td><span class="spoiler-label">'.$row[1].'</span><div class="spoiler-content" style="display: none"><br>'.$row[3].'</div><td>';
    

    then, when instead of for some reason changing ur correct <br/>‘s into the old version <br> tag, use the tag to create an array:

    $ary=explode('<br />',$row['3']);
    $str="";
    foreach($ary as $str2){
    $str.="<a href=\"$str2\">$str2</a><br/>";
    }
    

    and then echo $str into the row,

    Your code should be:

    $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;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my php coded page on one server that returns a json result.
I have a MD5 hash: 10f86782177490f2ac970b8dc4c51014 http://www.fileformat.info/tool/hash.htm?text=10f86782177490f2ac970b8dc4c51014 Result: c74e16d9 but PHP: crc32('10f86782177490f2ac970b8dc4c51014'); Result: -951183655
I have a table for a menu like below (see the HTML section): http://jsfiddle.net/6YZzb/
I have a MSSQL database table I'm accessing on a PHP page. I'm displaying
I have a php script that runs a mysql query, then loops the result,
I have a page as below: <head> <script type="text/javascript" src="jquery-1.6.1.js"></script> <script type="text/javascript"> $(document).ready( function()
I have a php page that pulls data from a mysql database based on
I have a script that calls a php page via jquery/ajax. The results would
I have some php querying and printing the info of a mysql table on
I have a page called index.html which takes in a few variable from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.