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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:30:30+00:00 2026-05-15T04:30:30+00:00

I have a table in my php code. In the second column of the

  • 0

I have a table in my php code. In the second column of the table, normally it displays “—“, and after i click the submit button, it will display the calculating result in the same page.

For example,

<table>
<tr><td>1</td><td>---</td></tr>
<tr><td>2</td><td>---</td></tr>
<tr><td>3</td><td>---</td></tr>
</table>

And in the same page, it should receive the variables

$var1 = $_POST[‘variable1’];

I’m not sure which way to use, ajax or javascript or just css?

Do you have any ideas?

Thanks

  • 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-15T04:30:31+00:00Added an answer on May 15, 2026 at 4:30 am

    You can use Javascript if you want to use the calculation on the client side, PHP if you want it on the server side. From your question I guess you want it on the server side.

    Just submit the form to the same page: action = "your_page.php".
    Test if the page is submitted via your form, then display the results (a table with the results), after you calculate them, of course. Else display the page like it is now.

    With JavaScript you can use DOM to select that exact td where you want your results and display them there, after you calculate them via JavaScript.

    A third option.. ajax, has the advantage that can calculate the results in real time (without pressing the submit button).

    You must decide what you want before using one of the methods, each one of them has some advantages and some disadvantages.

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

Sidebar

Related Questions

I have the following PHP code doing a very simple select into a table.
I have a table generated by PHP/mysql, I want a user to click the
I have one table which display data as from Dynamic Content in 1 column.
here is my mysql and php code layout: I have 3 tables tableA stores
I have some PHP code that generates dynamic tables of data on the fly.
I have a php table and i want the ability to delete rows of
i work with php/Mysql i have table with two cols (date , cash) with
I have created a php table like so: echo <table border = '0' cellpadding
I have a table FOLDERS ,everytime a folder is added through a php page
I have a problem with sorting items in table in PHP. Here is what

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.