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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:49:06+00:00 2026-05-24T11:49:06+00:00

echo ‘<a onClick=articleDeleteConfirm(‘. $row[title_$lang].’,’.$_GET[editPage]).’>’; The main problem is with: $row[title_$lang] , I have to

  • 0
echo '<a onClick="articleDeleteConfirm("'.
      $row["title_$lang"].'","'.$_GET["editPage"]).'">';

The main problem is with: $row["title_$lang"], I have to use $lang variable inside. " and ' just not enough.

  • 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-24T11:49:06+00:00Added an answer on May 24, 2026 at 11:49 am

    The problem you describe actually has nothing to do with your PHP variables, those are all being output as expected. The problem is that you need to escape the " inside of the <a> and you’ve misplaced a ).

    Your original would output:

    <a onClick="articleDeleteConfirm("value1","value2">
    

    That is not valid HTML (even the highlighter dislikes it). Now, notice the \‘s in the following (and that the paren was moved into the string).

    echo '<a onClick="articleDeleteConfirm(\''
         .$row["title_".$lang."].'\',\''.$_GET["editPage"].'\')">';
    

    The escaped version outputs:

    <a onClick="articleDeleteConfirm('value1','value2')">
    

    It uses single quotes inside of double quotes to provide easy to read (and valid) html. Now, you have another issue with your code.

    Any time you output a $_REQUEST variable to the browser, you risk something called cross-site-scripting. Someone could put JavaScript into $_GET["editPage"] and it would smell bad. The easy way to avoid it? Use htmlentities($_GET["editPage"])

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

Sidebar

Related Questions

@echo off for /f %%a in (httpd.conf) do ( echo %%a ) I have
echo '<img src=data:image/jpg/png/jpeg;base64,' . base64_encode( $row['image'] ) . ' height=150 />'; This is showing
echo '<td><a href='.$row_sv['website'].' target=_self\>'.$row_sv['name'].'</a></td>'; I don't want to use any target and changed it
echo $_POST['time'].<br/>; echo $_POST['day'].<br/>; echo $_POST['year'].<br/>; echo $_POST['month'].<br/>; I have value store like this
I have a simple 'echo' PB client and server where the client sends an
echo -n 'a001~!+rr001~!+1~!+TEST DATA 1' | awk 'BEGIN {FS=~!+} {print $2}' I have the
echo '<a onclick=load_tags('.$list['id'].')></a>' when list[id] is a number, it works. but when list[id] is
echo Info: <input type=\text\ name=\titel\> value=\ . $row['titel'] . \> . <br />; Why
echo Something=Something > file I can use paramiko's exec_command to do cat , grep
@echo off start /wait notepad start worpad This is the code i have written

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.