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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:07:21+00:00 2026-05-24T20:07:21+00:00

Here is how I am echoing back a ‘normal’ table cell in PHP: Code:

  • 0

Here is how I am echoing back a ‘normal’ table cell in PHP:

Code:

echo "<tr>";
  echo "<td>Some cell data</td>";
echo "</tr>\n";

Attempt to echo a button within a cell:

echo "<tr>";
echo "<td><form action="insertdata.php?page=add" method="post">
    Username: <input type="text" name="username" >
    <input type="submit" >
    </form>
    </td>";
echo "</tr>\n";

Thank you for any help, this is quite confusing to me. I am a beginner when it comes to PHP so please pardon any errors and feel free to kindly correct me wherever a correction is needed!

  • 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-24T20:07:22+00:00Added an answer on May 24, 2026 at 8:07 pm

    You need to either escape your double quotes " that appear inside your string surrounded by double quotes, or use a different quote style (i.e. single quotes ') to surround the string that contains the double quotes. It’s actually made quite obvious what the problem is by the syntax highlighting on this site.

    You could either do this:

    echo "<tr>";
    echo "<td><form action=\"insertdata.php?page=add\" method=\"post\">
        Username: <input type=\"text\" name=\"username\" >
        <input type=\"submit\" >
        </form>
        </td>";
    echo "</tr>\n";
    

    …or this…

    echo "<tr>";
    echo '<td><form action="insertdata.php?page=add" method="post">
        Username: <input type="text" name="username" >
        <input type="submit" >
        </form>
        </td>';
    echo "</tr>\n";
    

    I suggest you read this thoroughly so you no what you can and can’t legally do with strings in PHP.

    As a side note, it is a bad idea to put new-line literals inside quoted strings, as it can lead to cross-platform compatibility wierdness. It’s not really a problem with web output like this, but it’s a bad habit to get into. You should either use \r,\n and \r\n as appropriate, or if you must put literals into the source code, use heredoc syntax. Remember that escape sequences like \r\n are only interpolated in double quoted strings!!!

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

Sidebar

Related Questions

i use $.getJSON and here is my php file echo:ing back jsonstring for($i=1; $i<=10;
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here is my code, which takes two version identifiers in the form 1, 5,
Here is a link my example of the misaligned table rows Click preview in
I'm getting some pages with the get_pages function and echoing the page content like:
I am new to PHP and need your help here. I know the basic
I'm looking to echo an hyperlink in a PHP file. The target and text
here's the code: #include <string> class Config { public: static const std::string asdf =
Here's my simple first attempt at a python extension using boost. Can someone help
Here is a snippet of my JavaScript Code that I want to DRY up:

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.