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

  • Home
  • SEARCH
  • 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 7066043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:02:12+00:00 2026-05-28T05:02:12+00:00

I am trying to pass a php variable to my LinkONCLick4 function, but for

  • 0

I am trying to pass a php variable to my LinkONCLick4 function, but for some reason, the variable is not being passed to conversation.php and the function does not even work. I used this same function earlier on one of my web pages and it worked fine; I don’t why it is not working now. I anyone could help me that would be great!

<script>
    function LinkOnClick4(box) {
    $('#friendresults').load('conversation.php?id=' + box);
    }
    </script>
    <div id='showfriends' style='display:none;'>
    <div style="margin-top:5px;"><input type='text' name='searchfriends' id='searchfriends' class='searchfriends' autocomplete="off" value="Search for a friend..." onClick="this.style.border = '1px solid #4F94CD'; document.getElementById('friendresults').style.visibility = 'visible';" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue; this.style.border = '1px solid #5E5E5E';" onkeyup='searchfriends()'/></div>
    <div id='hrdiv3'></div>
    <div id='friendresults' name='friendresults' style='float:left;'>
    <?php
    $construct = "SELECT * FROM acceptedfriends WHERE profilename='$profilename' ORDER BY id DESC LIMIT 6";
    $run = mysql_query($construct);
    $foundnum = mysql_num_rows($run);
    while ($runrows = mysql_fetch_assoc($run))
    {
    $users = $runrows['username'];
    $location = $runrows['imagelocation'];
    $image = "<img src='$location' style='width:60px; height:40px;' />";
    if ($profilename==$username)
    {
    echo '<div id="hovercolor2" onclick="LinkOnClick4('.$users.')" style="width:294px; float:left;"><table><tr><td>'.$image.'</td><td><div style="margin-bottom:5px;"><a href="http://www.pearlsquirrel.com/'.$users.'" target="_blank">'.$users.'</a></div><div><a href="http://www.pearlsquirrel.com/conversation.php/'.$pageusers.'" style="text-decoration:underline;" target="_blank"><div style="font-size:.7em";>Click to enter a conversation.</div></a></div></td></tr></table></div><div id="hrdiv3" style="float:left; width:298px;"></div>';
    }
    else
    {
    echo '<div id="hovercolor2" style="width:294px; float:left;"><table><tr><td>'.$image.'</td><td><a href="http://www.pearlsquirrel.com/'.$users.'" target="_blank">'.$users.'</a></td></tr></table></div><div id="hrdiv3" style="float:left; width:298px;"></div>';
    }
    }
    ?>
    </div>
    </div>
    </div>
    </div>
</div>

  • 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-05-28T05:02:13+00:00Added an answer on May 28, 2026 at 5:02 am

    Try replace your line with this

    echo '<div id="hovercolor2" onclick="LinkOnClick4(\'' . $users . '\')" style="width:294px; float:left;"><table><tr><td>'.$image.'</td><td><div style="margin-bottom:5px;"><a href="http://www.pearlsquirrel.com/'.$users.'" target="_blank">'.$users.'</a></div><div><a href="http://www.pearlsquirrel.com/conversation.php/'.$pageusers.'" style="text-decoration:underline;" target="_blank"><div style="font-size:.7em";>Click to enter a conversation.</div></a></div></td></tr></table></div><div id="hrdiv3" style="float:left; width:298px;"></div>';
    

    Except for that, everything looks fine and I’m unable to find anything else that might be cause of the problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass a value via PHP to a Javascript function but it
I am trying to pass a variable frm php to a javascript function, however
In the change_text() function I am trying to pass it the xmhttp.responsetext variable.. but
I am trying to pass a php variable inside javascript bt it is not
I'm trying to get php to automatically pass the session ID via url, even
im trying to pass two parameters to a function, i being an int value
I am trying to take a PHP variable and pass it along to Flash
Trying to pass the variable flickrurl to a PHP page with jQuery/ajax. It works
I'm trying to pass a variable via jquery ajax call. I'm not exactly sure
I'm trying to pass variable from PHP file to Perl file by this code

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.