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 8001107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:00:15+00:00 2026-06-04T16:00:15+00:00

echo ‘<a onclick=load_tags(‘.$list[‘id’].’)></a>’ when list[id] is a number, it works. but when list[id] is

  • 0
echo '<a onclick="load_tags('.$list['id'].')"></a>'

when list[id] is a number, it works. but when list[id] is a word, it does not work. why?

below is some background on the function and what i am doing. although it is not necessary for the purposes of answering this question.

script

function load_tags(id){
        $.post('../php/tags/get_tags.php',{id:id},function(data){
            $('#tags_selected').text(data);
        });
    }

get_tags.php

$tag_id=$_POST['id'];
    echo $tag_id;
    $users_with_this_tag=show_all_users_with_this_tag($tag_id);
    if(count($users_with_this_tag)!=0){
            foreach($users_with_this_tag as $key => $list){
                echo $list['user_id'];
            }
    }else{
        echo'Nobody with this tag';
    }
  • 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-04T16:00:17+00:00Added an answer on June 4, 2026 at 4:00 pm

    Just surround load_tags argument with escaped single quotes:

    echo '<a onclick="load_tags(\''.$list['id'].'\')"></a>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP Echo or Print functions does not show anything when php is busy with
echo (<div style=\text-align:center\> . include ('file.php') . </div>\n); I'm not sure why, but whenever
echo <img src=.$file. > ; does not display image, while $file points to the
echo <input type=\text\ size=3 name=\{$item[\name\]}\/>; but following works fine echo <input type=\text\ size=3 name=\{$item['name']}\/>;
echo sed -i 's/NULL/\\N/g' .$_REQUEST['para']..sql; The above statement works. But it fail when I
echo(073032097109032116104101032118101114121032109111100101108032111102032097032109111100101114110032109097106111114032103101110101114097108046); Essentially, a very large number. Now, why does it output 241872 ? I
echo timezone_name_from_abbr(, 3600*7, 0); //ok echo timezone_name_from_abbr(, 3600*8, 0); //NOT ok! return nothing! echo
PHP echo function is not outputing strings in the format of html tag like
echo $path; //working function createList($retval) { echo $path; //not working print <form method='POST' action=''
Consider: echo 50 >> 4; Output: 3 Why does it output 3?

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.