Header

Is reloading <div> visible as page reloading? PHP

Basically I have a setup like this:

<body> 
<div id="header">
   <h3> Header </h3>
</div>

<div id="body">
</div>

<div id="foot">
</div>

      

The idea here is to guide the user through a six-step data fill wizard to calculate the value.

Each step is loaded into <div id="body">

, the first step is loaded through jQuery, and the steps after that are loaded through a JavaScript function.

The steps are named: step01.php, step02.php, etc.

now my question is when i load from step01.php to step02.php is <div id="body">

it treated as a page reload? Because I want to save the variables that are populated in step01.php to a session or another .php file. But since php is a server, I wanted to know if the file in the div is being reloaded as a full page reload?

If this is not possible without a full page reload, please suggest something else ... I have read some documentation about AJAX, but still seems very vague to me. So if anyone has a "tutorial newbie" please suggest.

At the moment I am storing variables in a JavaScript file, making cookies from it and then retrieving variables from cookies using php. But I know there is an easier way.

+3


source to share


3 answers


Yes, this counts as a "page load" to your server side php scripts. Anything you put in the session will be there for the next div reload.



+2


source


But since php is a server, I would like to know if the file is reloaded in a div like a full page reload?
In this condex, the answer is yes.


Server-side PHP has no idea about this div element you are using on the client. In general, php has very little interest in what the client is doing with the data / output of the server scripts.


All it cares about is the http roundtrip that happens on both a full page reload and when using ajax.


For the php core, it's all the same. The request arrives, some initialization takes place, scripts are processed, the output is sent to the client (as a stream of bytes - at this level php does not "understand" what you are sending to the client; html, plain-text, images, application code, after all for php ), some garbage collection occurs, mechanisms complete, terminate.
+2


source


They don't reload the page if you just load in a div using jQuery. those. the address in the address bar remains unchanged.

0


source







All Articles