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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:10:29+00:00 2026-05-30T23:10:29+00:00

I need some things clarified here: I have a website that updates the values

  • 0

I need some things clarified here:

I have a website that updates the values of two variables each time the site is reloaded in the browser. This page is obviously an HTML page but the variables are updated by javascript functions. This page runs on my server.

Can PHP retrieve the values of these variables and, using them, write them to a txt file or XML file? I realise javascript is a browser side language and PHP a server side language but I don’t know how the two can relate properly in this context.

Also I don’t have the option of recreating the javascript code as PHP script.

Is what I want to do possible?

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-30T23:10:30+00:00Added an answer on May 30, 2026 at 11:10 pm

    I am not sure when the variables are updated (if they are updated when the page is being generated, then why don’t you just do it with PHP only?). But if they are updated on the client side, based on some actions made by the user, then just do the following:

    1. After the JS variables are updated, issue AJAX call to the server, sending the data,
    2. On the server side, generate TXT or XML file using PHP, based on the data sent.

    The 1st can be done using eg. jQuery’s .post() method, and the second can be done by reading $_POST variable from within called PHP script (the one to which you send the data using AJAX), and by outputting it to TXT file (eg. by using PHP’s fwrite() function).

    EDIT: There is a great reference about AJAX. See Mozilla Developer Network article on Asynchronous JavaScript + XML (AJAX).

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

Sidebar

Related Questions

I have this application that need to do some things in protected paths (like
I have some things in my app that I need to store, in order
I have this thing that i need to do and some advices will be
I often have text in columns and need to replace some things without clobbering
I have some things I need to use custom SQL for. Just to start,
I have some things to do, but is bit complicated for me.I need some
I'm writing an application which need to have some things done by the matlab
I need to tweak some things inside Tomcat 6.0 before any web applications or
I'm working on a LaTeX package which might need to do some things differently
I wanna make the Mel-Frequency Cepstrum Algorithm but there are some things that I

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.