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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:10:26+00:00 2026-06-01T09:10:26+00:00

My webpage allows users to select items from a dropdown list and has a

  • 0

My webpage allows users to select items from a dropdown list and has a table. Javascript prints out each dropdown-list-item (plus extra info that javascript pulls from the XML file) in a new table row that javascript creates.

I want to be able to write the table information to disk.
If I was using Javascript, I would use document.getElementByID(“table”) to parse through the nodes and put that info into variables that I could write. However, most documentation I find says Javascript is not used for writing to disk. So, I think I should use php.

What is the php equivalent of Javascript’s ‘document’ object?
In Javascript I don’t need to define any new objects to use it, I can use ‘document’ anytime.
I think in php I have to use new DOMDocument. and then load the html.

Most of the php examples show loadHTML(string) and loadHTMLFile();
I don’t want to load HTML from a string that I write inside the tags.
And I don’t want to load HTML from the .htm file because that’s the original file and Javascript has changed the user’s file based on their selections from the dropdown menu.

I want to access the elements of the current document using php.
So, how does php refer to the current document?

The page I’m working on is http://music.collwyncraig.info/hajimama/setlist.htm

  • 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-01T09:10:27+00:00Added an answer on June 1, 2026 at 9:10 am

    I think your thoughts about the architecture are wrong. There is a way how the programming languages interact with each other.

    • php is a preprocessor and generates – what ever u want – usually html, containing javascript, css, and whatever…
    • javascript is a dynamic language that interacts in the generated html documents or calls by ajax other services that deliver html, javascript, css or whatever is needed
    • and html – that is document object that is displayed and can be modified during the runtime by javascript an styled by css, etc…

    So when u call in your documents javascript functions – the basic php has already done its job.

    Instead of printing all generated contents from php directly to the screen, you can store it first in a var.

    For example:

    $myContent = "<html><head>...</head><body><h1>Whatever...</h1></body>";
    

    so with that you can do the following to print it on the screen:

    print "myContent";  // and it is shown on the screen
    

    or

    $myFile = "testFile.html";
    $fh = fopen($myFile, 'w') or die("can't open file");
    $myContent = "<html><head>...</head><body><h1>Whatever...</h1></body>";
    fwrite($fh, $myContent);
    $myContent = "Whatever2";
    fwrite($fh, $myContent);
    fclose($fh); 
    

    So the contents of your file would be:

    <html><head>...</head><body><h1>Whatever...</h1></body>Whatever2
    

    This generated document can then be called by loadHTML or used in which way you
    want.

    This just as a hint into which direction you can think – there are quite multiple ways of solution – so without knowing more about what u really want – it is quite not easy to mention a proper solution.

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

Sidebar

Related Questions

I need to let users select an item from a dropdown list, but also
I have a listview which displays items retrieved from the webpage. Each item in
I want to allow users to select a local directory on a webpage (and
I am trying to create something on a webpage that allows my users to
I run a small webpage that allows users to click on various links using
I'm creating a web page that allows users to select a value using the
I have a webpage that uses JavaScript to retrieve JSON from a web service.
I'm writing a web page that has a from field that allows a user
I am writing a webpage that allows users to upload their files to Window
hi i have a webpage which allows users to enter the youtube video and

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.