Help is this possible - jquery - php - socket - update php variable?

Help is this possible - jquery - php - socket - update php variable?

Hi

I am new to jquery and I need an answer to this.

I have:

  1. Index.php:

  2. session_start();
  3. $page = "/update.php";
  4. $sec = "100";
  5. header("Refresh: $sec; url=$page");




  6. update.php 
  7. session_start();
  8. $start_word = "temp";
  9. $FirstArrive = shell_exec("python /share/word.py $start_word");

  10. $stringFirstArrive = explode(',', $FirstArrive);
  11. $stringFirstArrive = preg_replace('/[^A-Za-z0-9\+.:]/', ' ', $stringFirstArrive); // Removes special chars.
  12. $_SESSION['FirstArriveString'] = $stringFirstArrive;
  13. header("Refresh: 0; url='rpi.php'");


I have my index.php to be updated with data send not from the word.py but antoher .py (on another server) that this word.py starts.

a little tricky, because is it under build...

Right now it reload my index.page and redirect back from update.php to update my variasbles.
I just want my variables in index.php to be updated. after those 2 .py files are excuted. 

Is it possible with jquery?

Hope you can get the point, of my piece of .