Zurechtweiser
Zurechtweiser

Reputation: 1216

Open a webpage in the background, show the page has finished loading

How to run a php script in the background on the server when a user opens a webpage?

Important: The user does not note when the script finishes and DOES NOT NEED THE OUTPUT.

So the user nudges the script indirectly by visiting the webpage and that is all about it.

Upvotes: 0

Views: 439

Answers (2)

rajasaur
rajasaur

Reputation: 5460

Not sure I fully understand the question but you can make an AJAX call once the page is loaded, that calls the PHP backend that could load the page or do whatever it needs to do and return whatever data it needs to return back to the browser.

Upvotes: 0

rzetterberg
rzetterberg

Reputation: 10268

The only way would be to:

  1. Output the wrapper page.
  2. The wrapper page contains a javascript snippet which sends a AJAX request to the server.
  3. The server loads the page you want to show the user, the server returns the contents of the page.
  4. The javascript snippet displays the content.

Upvotes: 1

Related Questions