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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:42:36+00:00 2026-05-16T20:42:36+00:00

I am facing a problem in my code. Whenever I try to insert a

  • 0

I am facing a problem in my code. Whenever I try to insert
a text field then it’s giving an error. What’s wrong in the syntax here?

   print '<table>';
  print "<tr style='background-color:#CDC9C9;'>
<td><A HREF=\"http://localhost/cgi-bin/AddUser.cgi\">ADD</A></td>
<td></td>
<td><b>UserId</b></td>
<td><input type="text" name="UserId"></td>
<td><b>UserName</b></td>
 <td><input type="text" name="User_Name"></td>
 <td><input type="submit" name="Filter" value="Filter">  </td>
  </tr>";
print"</table>"; 
  • 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-16T20:42:37+00:00Added an answer on May 16, 2026 at 8:42 pm

    If you have a double-quoted string then it can’t contain unescaped double-quotes (for, hopefully, obvious reasons).

    Some ways to get around it:

    1/ Escape the double quotes.

    print "<tr style='background-color:#CDC9C9;'>
    <td><A HREF=\"http://localhost/cgi-bin/AddUser.cgi\">ADD</A></td>
    <td></td>
    <td><b>UserId</b></td>
    <td><input type=\"text\" name=\"UserId\"></td>
    <td><b>UserName</b></td>
    <td><input type=\"text\" name=\"User_Name\"></td>
    <td><input type=\"submit\" name=\"Filter\" value=\"Filter\">  </td>
    </tr>";
    

    2/ Switch to a single-quoted string (as your string contains no variables or escape sequences).

    print '<tr style="background-color:#CDC9C9;">
    <td><A HREF="http://localhost/cgi-bin/AddUser.cgi">ADD</A></td>
    <td></td>
    <td><b>UserId</b></td>
    <td><input type="text" name="UserId"></td>
    <td><b>UserName</b></td>
    <td><input type="text" name="User_Name"></td>
    <td><input type="submit" name="Filter" value="Filter">  </td>
    </tr>';
    

    Note: I had to change the single quotes in the style attribute to double quotes here.

    3/ Use a here-doc.

    print <<END_OF_HTML;
    <tr style='background-color:#CDC9C9;'>
    <td><A HREF="http://localhost/cgi-bin/AddUser.cgi">ADD</A></td>
    <td></td>
    <td><b>UserId</b></td>
    <td><input type="text" name="UserId"></td>
    <td><b>UserName</b></td>
    <td><input type="text" name="User_Name"></td>
    <td><input type="submit" name="Filter" value="Filter">  </td>
    </tr>
    END_OF_HTML
    

    4/ Choose a different quoting character.

    print qq[<tr style='background-color:#CDC9C9;'>
    <td><A HREF="http://localhost/cgi-bin/AddUser.cgi">ADD</A></td>
    <td></td>
    <td><b>UserId</b></td>
    <td><input type="text" name="UserId"></td>
    <td><b>UserName</b></td>
    <td><input type="text" name="User_Name"></td>
    <td><input type="submit" name="Filter" value="Filter">  </td>
    </tr>];
    

    But like so many of your problems, the real solution is to use a templating system.

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

Sidebar

Related Questions

The problem I am facing with below code is that whenever I try to
Here is my code <body scroll=yes onload=checkWhileOnload(#{Bean.conLimit},'#{Bean.URL}');checkLoadStatus();hideLoader();> The problem i m facing is the
I have developed some code, and I'm facing problem with error flagging of the
I'm facing an interesting problem here. I have a piece of code where I'd
Here, in PHP code I am facing problem to redirect a page after valid
I am new to android here i am facing problem when i try to
Iam facing problem in understanding and converting a matlab code into opencv. I want
I am facing a problem with EF Code First with TPH. I am getting
iam facing problem in passing array to view. this is my controller code.. function
i am using mvc 3 code first. facing problem while passing data form SecurityAttribute

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.