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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:56:03+00:00 2026-06-12T18:56:03+00:00

Hi I put a sample code I’ve done below to explain my concern. Simply

  • 0

Hi I put a sample code I’ve done below to explain my concern. Simply the code works fine except displaying the ‘echo’ messages in a desired location on the page. when the code is executed, the echo messages appear just on the page, but I need the message to be appear in the ‘cell4’ table cell.

I tried modifying the code as {echo “Name is blank!”; return false;} on the line 30, but seems that its not a correct method as no change in the result. Can someone please tell me is there a workaround for this? Thanks for looking.

Here goes the code:

    <html>
<head><title>Test</title></head>

<body>
<form method="POST" action="<?= $_SERVER['PHP_SELF'] ?>">
<table border="1">
<thead>
<tr>
    <td colspan="4">User detail</td>
</tr>
</thead>

<tr>
    <td id="cell1">Name:</td>
    <td id="cell2"><input type="text" name="Uname"></td>
    <td id="cell3"><input type="submit" name="SendNow" value="Save"></td>
    <td id="cell4"></td>
</tr>
</table>
</form>
</body>
</html>

<?php 
if(isset($_POST['SendNow']))
{
$nm = $_POST['Uname'];

    if($nm == "")
        {echo "Name is blank!"; return false;}
    else
        {echo "Well done!"; return false;}
}       

?>

Sorry the edited code has not appeared correct in the above text. This is how I have tried modifying : {echo "<td id='cell4'>Name is blank!</td>"; return false;} 
  • 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-12T18:56:04+00:00Added an answer on June 12, 2026 at 6:56 pm
    <?php 
    if(isset($_POST['SendNow']))
    {
    $nm = $_POST['Uname'];
        $message = '';
        if($nm == "")
            {$message = "Name is blank!";}
        else
            {$message = "Well done!";}
    }       
    
    ?>
    <html>
    <head><title>Test</title></head>
    
    <body>
    <form method="POST" action="<?= $_SERVER['PHP_SELF'] ?>">
    <table border="1">
    <thead>
    <tr>
        <td colspan="4">User detail</td>
    </tr>
    </thead>
    
    <tr>
        <td id="cell1">Name:</td>
        <td id="cell2"><input type="text" name="Uname"></td>
        <td id="cell3"><input type="submit" name="SendNow" value="Save"></td>
        <td id="cell4"><?php if (!empty($message)) echo $message; ?></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sample code snippet below which works just fine (I trimmed the
I've put together a small code-sample below (Currently in C# 3.5 but would also
How does async JMS work? I've below sample code: public class JmsAdapter implements MessageListener,
Please check the following sample code. Toast messages are shown but the progressdialog is
I dont have time right this second to put some sample code, (Ill edit
I'm attempting to learn some Python and Tkinter. The sample code below is intended
I am still learning Sweave and R . I have below a sample code
How can I put Caret in JTextArea while setEditable is disabled? A sample code
I've whipped out an app using the sample code in Take Pictures Simply ,
To make this more clear, I'm going to put code samples: $file = fopen('filename.ext',

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.