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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:40:38+00:00 2026-05-25T02:40:38+00:00

If a user refreshes a page I need to send the data using php

  • 0

If a user refreshes a page I need to send the data using php as it accesses a mysql table.

If the user adds content, I don’t want to run an AJAX call “first” as I can simply and immediately update the DOM, and then send a one-way ajax call to store it in the mysql table.

So on a referesh I have PHP creating my XHTML and sending it to the Browser.

On user input, I have the DOM update immediately followed by ajax call to put it in the mysql table.

Thing is I have to write code in JS and PHP for each user action that modifies the page.

Should I have the data sent to the Javascript for entry into the DOM and not do less with it in the PHP. What are the tradeoffs from taking user input and converting it to the UI with javascript vs. php?

Should I offload as much as possible to the client to reduce server load?

  • 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-25T02:40:39+00:00Added an answer on May 25, 2026 at 2:40 am

    You have answered it yourself:

    • With php you need to send it through ajax and wait for response
    • With javascript you need to maintain 2 set of templates (server- and client-side one)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using ASP.Net MVC TempData to store form data between page refreshes. We
I am using Starbox in my Spring page. I want to submit the user
I'm using a repeater on my page. I want to populate this repeater based
I have a MySQL table holding lots of records that i want to give
When a user hits Refresh on their browser, it reloads the page but keeps
i need to check whether the user clicking the browser Refresh button and redirect
I need to find whether the user clicking the browser back button or Refresh
User kokos answered the wonderful Hidden Features of C# question by mentioning the using
User A logs into a ticket management system to edit content on SomePage.aspx User
User is a model. I have 100 users. I need to present the list

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.